prithivMLmods commited on
Commit
a1bbb8d
1 Parent(s): ff03872

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,8 +8,8 @@ footer {
8
  visibility: hidden
9
  }
10
  '''
11
- client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
12
 
 
13
 
14
  mood_prompts = {
15
  "Fun": "Respond in a light-hearted, playful manner.",
@@ -99,14 +99,14 @@ def generate(
99
  for response in stream:
100
  output += response.token.text
101
  yield output
102
- return output
 
103
 
104
  def gradio_interface():
105
  with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
106
  # Initialize state for history
107
  history = gr.State([])
108
 
109
-
110
  # Row for system prompt and user prompt
111
  with gr.Row():
112
  system_prompt = gr.Textbox(placeholder="System prompt (optional)", lines=1, visible=False)
 
8
  visibility: hidden
9
  }
10
  '''
 
11
 
12
+ client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.3")
13
 
14
  mood_prompts = {
15
  "Fun": "Respond in a light-hearted, playful manner.",
 
99
  for response in stream:
100
  output += response.token.text
101
  yield output
102
+
103
+ history.append((prompt, output)) # Append the latest interaction to history
104
 
105
  def gradio_interface():
106
  with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
107
  # Initialize state for history
108
  history = gr.State([])
109
 
 
110
  # Row for system prompt and user prompt
111
  with gr.Row():
112
  system_prompt = gr.Textbox(placeholder="System prompt (optional)", lines=1, visible=False)