cotxetj commited on
Commit
9a63ffb
1 Parent(s): ce545b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -159,9 +159,7 @@ def gpt_predict(inputs, request:gr.Request=gr.State([]), top_p = 1, temperature
159
  token_counter += 1
160
  except Exception as e:
161
  print (f'error found: {e}')
162
- print("hist=", history)
163
- print("part", partial_words)
164
- return history[-1][-1]
165
 
166
 
167
  # Define the pipeline
@@ -177,7 +175,7 @@ def predict(transType, language, audio, audio_mic = None):
177
  if not audio and audio_mic:
178
  audio = audio_mic
179
  st = gr.State([])
180
- return gpt_predict("Hi chat!",st), None
181
  if transType == "Text":
182
  return translate(audio), None
183
  if transType == "GPT answer":
@@ -211,7 +209,7 @@ demo = gr.Interface(
211
 
212
  ],
213
  outputs=[
214
- gr.Text(label="Text translation or gpt answer"),gr.Audio(label="Audio translation",type = "numpy")
215
  ],
216
  title=title,
217
  description=description,
 
159
  token_counter += 1
160
  except Exception as e:
161
  print (f'error found: {e}')
162
+ return partial_words
 
 
163
 
164
 
165
  # Define the pipeline
 
175
  if not audio and audio_mic:
176
  audio = audio_mic
177
  st = gr.State([])
178
+ return "Tell me about the swedish king in 1995!?", gpt_predict("Tell me about the swedish king in 1995!?",st), None
179
  if transType == "Text":
180
  return translate(audio), None
181
  if transType == "GPT answer":
 
209
 
210
  ],
211
  outputs=[
212
+ gr.Text(label="Text translation"),gr.Text(label="gpt answer"),gr.Audio(label="Audio translation",type = "numpy")
213
  ],
214
  title=title,
215
  description=description,