eduardo-alvarez commited on
Commit
53b6e2c
1 Parent(s): ef0f6a7

fixed chatbot gradio dep issues with workaround

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -1,8 +1,16 @@
1
- import gradio as gr
2
  import pandas as pd
3
  import requests
4
  import os
5
 
 
 
 
 
 
 
 
 
 
6
  from info.train_a_model import (
7
  LLM_BENCHMARKS_TEXT)
8
  from info.submit import (
@@ -69,7 +77,7 @@ with demo:
69
  """
70
  response = ''
71
  for char in call_api_and_stream_response(query, chat_model=chat_model_selection):
72
- if char == '<': # This seems to be your stopping condition; adjust as needed.
73
  break
74
  response += char
75
  yield [(f"🤖 Response from LLM: {chat_model_selection}", response)] # Correct format for Gradio Chatbot
 
 
1
  import pandas as pd
2
  import requests
3
  import os
4
 
5
+ import gradio
6
+
7
+ # work around due to HF Spaces bug
8
+ if gradio.__version__ != '4.16.0':
9
+ os.system("pip uninstall -y gradio")
10
+ os.system("pip install gradio==4.16.0")
11
+
12
+ import gradio as gr
13
+
14
  from info.train_a_model import (
15
  LLM_BENCHMARKS_TEXT)
16
  from info.submit import (
 
77
  """
78
  response = ''
79
  for char in call_api_and_stream_response(query, chat_model=chat_model_selection):
80
+ if char == '<': # This is stopping condition; adjust as needed.
81
  break
82
  response += char
83
  yield [(f"🤖 Response from LLM: {chat_model_selection}", response)] # Correct format for Gradio Chatbot