Spaces:
Runtime error
Runtime error
Update app.py (#7)
Browse files- Update app.py (82904ca5159ec79668200adaa69d5c6aebfe5c46)
Co-authored-by: Yanis Adel <[email protected]>
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 = []
|
|
@@ -74,10 +74,13 @@ def run_chatnt(input_file, custom_question):
|
|
| 74 |
else:
|
| 75 |
return None
|
| 76 |
with open(log_file, "a") as log:
|
| 77 |
-
log.write(f"
|
|
|
|
| 78 |
|
| 79 |
# Call model
|
| 80 |
-
|
|
|
|
|
|
|
| 81 |
output = pipe(
|
| 82 |
inputs={
|
| 83 |
"english_sequence": english_sequence,
|
|
@@ -96,13 +99,13 @@ footer { display: none !important; }
|
|
| 96 |
"""
|
| 97 |
|
| 98 |
with gr.Blocks(css=css) as demo:
|
| 99 |
-
gr.Markdown("# 🧬 ChatNT
|
| 100 |
|
| 101 |
with gr.Row():
|
| 102 |
with gr.Column(scale=1):
|
| 103 |
input_file = gr.File(
|
| 104 |
-
label="Upload DNA Sequence File (.fasta
|
| 105 |
-
file_types=[".fasta", ".fa"
|
| 106 |
)
|
| 107 |
custom_question = gr.Textbox(
|
| 108 |
label="English Question (required)",
|
|
|
|
| 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 = []
|
|
|
|
| 74 |
else:
|
| 75 |
return None
|
| 76 |
with open(log_file, "a") as log:
|
| 77 |
+
log.write(f"Initial user question : {custom_question}")
|
| 78 |
+
log.write(f"Full english prompt : {english_sequence}")
|
| 79 |
|
| 80 |
# Call model
|
| 81 |
+
with open(log_file, "a") as log:
|
| 82 |
+
log.write("Calling model")
|
| 83 |
+
|
| 84 |
output = pipe(
|
| 85 |
inputs={
|
| 86 |
"english_sequence": english_sequence,
|
|
|
|
| 99 |
"""
|
| 100 |
|
| 101 |
with gr.Blocks(css=css) as demo:
|
| 102 |
+
gr.Markdown("# 🧬 ChatNT: A Multimodal Conversational Agent for DNA, RNA and Protein Tasks")
|
| 103 |
|
| 104 |
with gr.Row():
|
| 105 |
with gr.Column(scale=1):
|
| 106 |
input_file = gr.File(
|
| 107 |
+
label="Upload DNA Sequence File (.fasta)",
|
| 108 |
+
file_types=[".fasta", ".fa"]
|
| 109 |
)
|
| 110 |
custom_question = gr.Textbox(
|
| 111 |
label="English Question (required)",
|