cindyangelira commited on
Commit
e8675dc
1 Parent(s): 14b8d61

Update space

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -30,20 +30,21 @@ def respond(
30
  message_stream = client.chat_completion(
31
  messages,
32
  max_tokens=max_tokens,
33
- stream=False,
34
  temperature=temperature,
35
  top_p=top_p,
36
  )
37
 
38
- final_response = response.choices[0].message["content"]
39
- yield final_response
 
 
40
 
41
-
42
  # Define the Gradio interface with a clean setup
43
  def create_demo():
44
  with gr.Blocks() as demo:
45
  # Add logo at the top
46
- gr.Image("auntie.png", label="App Logo")
47
  gr.Markdown("Talk To Your Auntie")
48
 
49
  # Define ChatInterface below the logo
 
30
  message_stream = client.chat_completion(
31
  messages,
32
  max_tokens=max_tokens,
33
+ stream=True,
34
  temperature=temperature,
35
  top_p=top_p,
36
  )
37
 
38
+ for message in message_stream:
39
+ token = message.choices[0].delta.content
40
+ response += token
41
+ yield response
42
 
 
43
  # Define the Gradio interface with a clean setup
44
  def create_demo():
45
  with gr.Blocks() as demo:
46
  # Add logo at the top
47
+ # gr.Image("auntie.png", label="App Logo")
48
  gr.Markdown("Talk To Your Auntie")
49
 
50
  # Define ChatInterface below the logo