Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import torch
|
|
| 4 |
import threading
|
| 5 |
import spaces
|
| 6 |
|
| 7 |
-
# --- Model and Tokenizer Setup
|
| 8 |
# Load model and tokenizer
|
| 9 |
model_name = "krish10/Qwen3_0.6B_16bit_TA_screen"
|
| 10 |
pipe = pipeline("text-generation", model=model_name, device=0)
|
|
@@ -16,7 +16,7 @@ MAX_TOKENS = 3000
|
|
| 16 |
TEMPERATURE = 0.1
|
| 17 |
TOP_P = 0.9
|
| 18 |
|
| 19 |
-
# --- Backend Function
|
| 20 |
@spaces.GPU
|
| 21 |
def respond_stream(population, intervention, comparison, outcome, study_design, summary, title, abstract):
|
| 22 |
# Validate required fields
|
|
@@ -111,7 +111,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="sky")) as
|
|
| 111 |
)
|
| 112 |
|
| 113 |
# Output and Action Buttons
|
| 114 |
-
output_box = gr.Markdown(label="Model Response"
|
| 115 |
|
| 116 |
with gr.Row():
|
| 117 |
clear_btn = gr.Button("Clear")
|
|
@@ -129,6 +129,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="sky")) as
|
|
| 129 |
# The clear button resets all input fields and the output box
|
| 130 |
clear_btn.click(lambda: (None, None, None, None, None, None, None, None, None), outputs=all_inputs + [output_box])
|
| 131 |
|
|
|
|
| 132 |
# --- Launch the App ---
|
| 133 |
if __name__ == "__main__":
|
| 134 |
demo.launch()
|
|
|
|
| 4 |
import threading
|
| 5 |
import spaces
|
| 6 |
|
| 7 |
+
# --- Model and Tokenizer Setup ---
|
| 8 |
# Load model and tokenizer
|
| 9 |
model_name = "krish10/Qwen3_0.6B_16bit_TA_screen"
|
| 10 |
pipe = pipeline("text-generation", model=model_name, device=0)
|
|
|
|
| 16 |
TEMPERATURE = 0.1
|
| 17 |
TOP_P = 0.9
|
| 18 |
|
| 19 |
+
# --- Backend Function ---
|
| 20 |
@spaces.GPU
|
| 21 |
def respond_stream(population, intervention, comparison, outcome, study_design, summary, title, abstract):
|
| 22 |
# Validate required fields
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
# Output and Action Buttons
|
| 114 |
+
output_box = gr.Markdown(label="Model Response") # CORRECTED LINE
|
| 115 |
|
| 116 |
with gr.Row():
|
| 117 |
clear_btn = gr.Button("Clear")
|
|
|
|
| 129 |
# The clear button resets all input fields and the output box
|
| 130 |
clear_btn.click(lambda: (None, None, None, None, None, None, None, None, None), outputs=all_inputs + [output_box])
|
| 131 |
|
| 132 |
+
|
| 133 |
# --- Launch the App ---
|
| 134 |
if __name__ == "__main__":
|
| 135 |
demo.launch()
|