aasd
Browse files
app.py
CHANGED
@@ -73,22 +73,23 @@ def run_merge_and_push():
|
|
73 |
return "Model merged and pushed to Hugging Face Hub successfully!"
|
74 |
|
75 |
# Gradio interface
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
)
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
88 |
|
89 |
# Launch the interface
|
90 |
if __name__ == "__main__":
|
91 |
-
|
92 |
-
[iface, gr.Interface(fn=lambda: "", inputs=None, outputs=merge_and_push_output)],
|
93 |
-
["Generate Text", "Merge and Push"]
|
94 |
-
).launch()
|
|
|
73 |
return "Model merged and pushed to Hugging Face Hub successfully!"
|
74 |
|
75 |
# Gradio interface
|
76 |
+
with gr.Blocks() as demo:
|
77 |
+
with gr.TabbedInterface(["Generate Text", "Merge and Push"]) as tabs:
|
78 |
+
with tabs[0]:
|
79 |
+
iface = gr.Interface(
|
80 |
+
fn=generate_text,
|
81 |
+
inputs=gr.Textbox(lines=5, label="Input Text"),
|
82 |
+
outputs=gr.Textbox(lines=10, label="Generated Text"),
|
83 |
+
title="Merged Llama 3 8B Instruct Model",
|
84 |
+
description="Enter text to generate a response from the merged model.",
|
85 |
+
)
|
86 |
+
iface.launch()
|
87 |
+
|
88 |
+
with tabs[1]:
|
89 |
+
merge_and_push_button = gr.Button("Merge Models and Push to Hub")
|
90 |
+
merge_and_push_output = gr.Textbox(lines=20, label="Merge and Push Output")
|
91 |
+
merge_and_push_button.click(run_merge_and_push, outputs=merge_and_push_output)
|
92 |
|
93 |
# Launch the interface
|
94 |
if __name__ == "__main__":
|
95 |
+
demo.launch()
|
|
|
|
|
|