Spaces:
Runtime error
Runtime error
Update app.py
#6
by
Yanisadel
- opened
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def run_chatnt(input_file, custom_question):
|
|
| 28 |
log.write("Request started\n")
|
| 29 |
|
| 30 |
if not custom_question or custom_question.strip() == "":
|
| 31 |
-
None
|
| 32 |
|
| 33 |
# Read DNA sequences
|
| 34 |
dna_sequences = []
|
|
@@ -73,11 +73,10 @@ def run_chatnt(input_file, custom_question):
|
|
| 73 |
english_sequence = custom_question
|
| 74 |
else:
|
| 75 |
return None
|
| 76 |
-
with open(log_file, "a") as log:
|
| 77 |
-
log.write(f"English prompt : {english_sequence}")
|
| 78 |
|
| 79 |
# Call model
|
| 80 |
-
|
|
|
|
| 81 |
output = pipe(
|
| 82 |
inputs={
|
| 83 |
"english_sequence": english_sequence,
|
|
@@ -85,7 +84,6 @@ def run_chatnt(input_file, custom_question):
|
|
| 85 |
}
|
| 86 |
)
|
| 87 |
|
| 88 |
-
log.write(f"Output : {output}")
|
| 89 |
return output
|
| 90 |
|
| 91 |
# --- Gradio Interface ---
|
|
|
|
| 28 |
log.write("Request started\n")
|
| 29 |
|
| 30 |
if not custom_question or custom_question.strip() == "":
|
| 31 |
+
return None
|
| 32 |
|
| 33 |
# Read DNA sequences
|
| 34 |
dna_sequences = []
|
|
|
|
| 73 |
english_sequence = custom_question
|
| 74 |
else:
|
| 75 |
return None
|
|
|
|
|
|
|
| 76 |
|
| 77 |
# Call model
|
| 78 |
+
with open(log_file, "a") as log:
|
| 79 |
+
log.write("Calling model")
|
| 80 |
output = pipe(
|
| 81 |
inputs={
|
| 82 |
"english_sequence": english_sequence,
|
|
|
|
| 84 |
}
|
| 85 |
)
|
| 86 |
|
|
|
|
| 87 |
return output
|
| 88 |
|
| 89 |
# --- Gradio Interface ---
|