Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -457,9 +457,10 @@ async def generate_function_call(prompt):
|
|
457 |
template = env.get_template("function_calling.txt")
|
458 |
|
459 |
content = template.render(question=prompt)
|
460 |
-
|
461 |
-
output =
|
462 |
-
|
|
|
463 |
pattern = r'\{[^{}]*\}'
|
464 |
# Find all matches
|
465 |
match = re.search(pattern, output)
|
|
|
457 |
template = env.get_template("function_calling.txt")
|
458 |
|
459 |
content = template.render(question=prompt)
|
460 |
+
stream = client2.text_generation(content, **generate_kwargs, stream=True, details=True, return_full_text=True)
|
461 |
+
output = ""
|
462 |
+
for response in stream:
|
463 |
+
output += response.token.text
|
464 |
pattern = r'\{[^{}]*\}'
|
465 |
# Find all matches
|
466 |
match = re.search(pattern, output)
|