Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,20 @@
|
|
| 1 |
import gradio
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
|
| 5 |
def process(file, role, complexity):
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
roles_dropdown = gradio.Dropdown(
|
|
@@ -25,4 +36,4 @@ demo = gr.Interface(
|
|
| 25 |
allow_flagging="never"
|
| 26 |
)
|
| 27 |
|
| 28 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio
|
| 2 |
import gradio as gr
|
| 3 |
+
import requests
|
| 4 |
|
| 5 |
|
| 6 |
def process(file, role, complexity):
|
| 7 |
+
try:
|
| 8 |
+
file_upload_api_url = "http://52.66.227.53:5601/uploadFile"
|
| 9 |
+
query_api_url = "http://52.66.227.53:5601/query"
|
| 10 |
+
|
| 11 |
+
files = {'file': open(file, 'rb')}
|
| 12 |
+
file_upload_response = requests.post(file_upload_api_url, files=files, verify=False)
|
| 13 |
+
print(file_upload_response.status_code)
|
| 14 |
+
query_response = requests.get(query_api_url, params={'text': f'You are an expert interviewer. Generate few {complexity} interview questions for the role {role} based on the resume given'})
|
| 15 |
+
return query_response.text
|
| 16 |
+
except Exception as err:
|
| 17 |
+
return err
|
| 18 |
|
| 19 |
|
| 20 |
roles_dropdown = gradio.Dropdown(
|
|
|
|
| 36 |
allow_flagging="never"
|
| 37 |
)
|
| 38 |
|
| 39 |
+
demo.launch(auth=[("arvind", "!abcd1234"), ("srikkanth", "!abcd1234")])
|