Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,11 +6,11 @@ import os
|
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
-
def generate_answer(
|
| 10 |
try:
|
| 11 |
client = Client(os.getenv("host"), hf_token=os.getenv("nekot"))
|
| 12 |
json_path = client.predict(fn_index=1) # Auto-detect the path
|
| 13 |
-
response = client.predict(
|
| 14 |
with open(response[1], 'r') as json_file:
|
| 15 |
data = json.load(json_file)[0]
|
| 16 |
prompt = data[0]
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
+
def generate_answer(Question=""):
|
| 10 |
try:
|
| 11 |
client = Client(os.getenv("host"), hf_token=os.getenv("nekot"))
|
| 12 |
json_path = client.predict(fn_index=1) # Auto-detect the path
|
| 13 |
+
response = client.predict(Question, json_path, fn_index=0)
|
| 14 |
with open(response[1], 'r') as json_file:
|
| 15 |
data = json.load(json_file)[0]
|
| 16 |
prompt = data[0]
|