dfinel commited on
Commit
604df81
1 Parent(s): 3382438

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -11,7 +11,7 @@ from bert_regression import get_ratings_dic
11
  import os
12
  from langchain.llms import OpenAI
13
  import gradio as gr
14
-
15
 
16
  os.environ["OPENAI_API_KEY"] = "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"
17
 
@@ -257,6 +257,7 @@ def get_reviews(url):
257
  #print(get_reviews(url))
258
 
259
  if __name__ == '__main__':
 
260
  interface = gr.Interface(fn=get_reviews, inputs=gr.Textbox(), outputs=[gr.Textbox(label = 'Real ratings'),gr.Textbox(label = 'Actionable insights')], title='The Topic Magnet',
261
  description='Enter the url of your Amazon reviews to get real ratings and valuable insights')
262
  interface.launch()
 
11
  import os
12
  from langchain.llms import OpenAI
13
  import gradio as gr
14
+ import asyncio
15
 
16
  os.environ["OPENAI_API_KEY"] = "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"
17
 
 
257
  #print(get_reviews(url))
258
 
259
  if __name__ == '__main__':
260
+ asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())import asyncio
261
  interface = gr.Interface(fn=get_reviews, inputs=gr.Textbox(), outputs=[gr.Textbox(label = 'Real ratings'),gr.Textbox(label = 'Actionable insights')], title='The Topic Magnet',
262
  description='Enter the url of your Amazon reviews to get real ratings and valuable insights')
263
  interface.launch()