azunre commited on
Commit
129570f
·
verified ·
1 Parent(s): 08d14ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -40,8 +40,9 @@ with gr.Blocks(fill_height=True) as demo:
40
  def generate(prompt,history,language):
41
  print(history)
42
  output = client.predict(prompt,language)
 
43
  history.append([prompt,output])
44
- return history
45
 
46
  with gr.Blocks(fill_height=True) as demo:
47
  title = gr.Markdown(
@@ -49,6 +50,7 @@ with gr.Blocks(fill_height=True) as demo:
49
  # African Language Chatbot (Khaya)
50
  SELECT YOUR LANGUAGE BELOW!
51
  """)
 
52
  language_selector = gr.Dropdown(["Amharic","Twi","Dagbani","Ewe","Ga","Gurene","Fante","Hausa", "Kikuyu", "Kimeru", "Luo","Shona","Swahili","Tigrinya","Yoruba"],value="Twi",label="Choose Language! (default is Twi)", info="Language:")
53
  main_block = gr.ChatInterface(fn=generate, additional_inputs = language_selector,
54
  description = 'Select an African language above and type messages below in selected language')
 
40
  def generate(prompt,history,language):
41
  print(history)
42
  output = client.predict(prompt,language)
43
+ print(output)
44
  history.append([prompt,output])
45
+ return output
46
 
47
  with gr.Blocks(fill_height=True) as demo:
48
  title = gr.Markdown(
 
50
  # African Language Chatbot (Khaya)
51
  SELECT YOUR LANGUAGE BELOW!
52
  """)
53
+ #history_var = gr.State([]) # conversation history
54
  language_selector = gr.Dropdown(["Amharic","Twi","Dagbani","Ewe","Ga","Gurene","Fante","Hausa", "Kikuyu", "Kimeru", "Luo","Shona","Swahili","Tigrinya","Yoruba"],value="Twi",label="Choose Language! (default is Twi)", info="Language:")
55
  main_block = gr.ChatInterface(fn=generate, additional_inputs = language_selector,
56
  description = 'Select an African language above and type messages below in selected language')