zinoubm commited on
Commit
0d80d9a
·
1 Parent(s): 8c2963b

adding the url to env

Browse files
Files changed (2) hide show
  1. app.py +7 -1
  2. requirements.txt +2 -1
app.py CHANGED
@@ -1,11 +1,17 @@
 
1
  import gradio as gr
2
  import requests
 
 
 
 
 
3
 
4
 
5
  def get_answer(question):
6
  try:
7
  answer = requests.get(
8
- "http://127.0.0.1:8000/api/",
9
  json={"question": question},
10
  )
11
  except Exception as err:
 
1
+ import os
2
  import gradio as gr
3
  import requests
4
+ from dotenv import load_dotenv
5
+
6
+ load_dotenv()
7
+
8
+ url = os.getenv("URL")
9
 
10
 
11
  def get_answer(question):
12
  try:
13
  answer = requests.get(
14
+ url,
15
  json={"question": question},
16
  )
17
  except Exception as err:
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- gradio
 
 
1
+ gradio
2
+ python-dotenv