vericudebuget commited on
Commit
b910b4b
·
verified ·
1 Parent(s): 2d89603

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -40,11 +40,10 @@ def generate(
40
 
41
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
42
 
43
- output = ""
44
  for response in stream:
45
- output += response.token.text
46
-
47
- yield output
48
 
49
  additional_inputs = [
50
  gr.Textbox(label="System Prompt", max_lines=1, interactive=True),
 
40
 
41
  stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
42
 
43
+ output_text = ""
44
  for response in stream:
45
+ output_text += response.token.text
46
+ yield output_text, history # Yield the updated output_text and the updated history
 
47
 
48
  additional_inputs = [
49
  gr.Textbox(label="System Prompt", max_lines=1, interactive=True),