Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -59,26 +59,6 @@ def compare_models(prompt):
|
|
59 |
output2 = future2.result()
|
60 |
return output1, output2
|
61 |
|
62 |
-
|
63 |
-
def compare_models(prompt, temperature, top_p):
|
64 |
-
output1 = generate_text_model1(prompt, temperature, top_p)
|
65 |
-
output2 = generate_text_model2(prompt, temperature, top_p)
|
66 |
-
|
67 |
-
# Include the parameter settings in the outputs
|
68 |
-
output1_with_params = f"**Temperature:** {temperature}, **Top-p:** {top_p}\n\n{output1}"
|
69 |
-
output2_with_params = f"**Temperature:** {temperature}, **Top-p:** {top_p}\n\n{output2}"
|
70 |
-
|
71 |
-
return output1_with_params, output2_with_params
|
72 |
-
|
73 |
-
# Use ThreadPoolExecutor to Process in Parallel
|
74 |
-
def compare_models(prompt):
|
75 |
-
with concurrent.futures.ThreadPoolExecutor() as executor:
|
76 |
-
future1 = executor.submit(generate_text_model1, prompt)
|
77 |
-
future2 = executor.submit(generate_text_model2, prompt)
|
78 |
-
output1 = future1.result()
|
79 |
-
output2 = future2.result()
|
80 |
-
return output1, output2
|
81 |
-
|
82 |
# Create Gradio Interface
|
83 |
iface = gr.Interface(
|
84 |
fn=compare_models,
|
|
|
59 |
output2 = future2.result()
|
60 |
return output1, output2
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
# Create Gradio Interface
|
63 |
iface = gr.Interface(
|
64 |
fn=compare_models,
|