Spaces:
Runtime error
Runtime error
File size: 1,894 Bytes
c68d4da 74d8f99 c68d4da 851ab49 5e1af85 851ab49 74d8f99 851ab49 5e1af85 851ab49 5e1af85 851ab49 5e1af85 851ab49 74d8f99 851ab49 5e1af85 851ab49 5e1af85 851ab49 74d8f99 851ab49 5e1af85 07bc0ab 851ab49 c68d4da 851ab49 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
import gradio as gr
import os
def test_model(input_text):
"""Simple test function"""
if not input_text.strip():
return "Please enter some text to test."
# Simple echo response for now
return f"Echo: {input_text} (Model: tasal9/ZamAI-Mistral-7B-Pashto)"
def train_model(dataset_text):
"""Training function"""
if not dataset_text.strip():
return "Please provide training data."
return f"Training started for tasal9/ZamAI-Mistral-7B-Pashto\nData length: {len(dataset_text)} characters"
def finetune_model(dataset_text):
"""Fine-tuning function"""
if not dataset_text.strip():
return "Please provide fine-tuning data."
return f"Fine-tuning started for tasal9/ZamAI-Mistral-7B-Pashto\nData length: {len(dataset_text)} characters"
# Create interface
with gr.Blocks(title="ZamAI-Mistral-7B-Pashto") as demo:
gr.Markdown(f"# ZamAI-Mistral-7B-Pashto Training Space")
with gr.Tab("Test"):
with gr.Row():
test_input = gr.Textbox(label="Input", lines=2)
test_output = gr.Textbox(label="Output", lines=2)
test_btn = gr.Button("Test")
test_btn.click(test_model, inputs=test_input, outputs=test_output)
with gr.Tab("Train"):
train_input = gr.Textbox(label="Training Data", lines=5)
train_output = gr.Textbox(label="Training Status", lines=3)
train_btn = gr.Button("Start Training")
train_btn.click(train_model, inputs=train_input, outputs=train_output)
with gr.Tab("Fine-tune"):
finetune_input = gr.Textbox(label="Fine-tuning Data", lines=5)
finetune_output = gr.Textbox(label="Fine-tuning Status", lines=3)
finetune_btn = gr.Button("Start Fine-tuning")
finetune_btn.click(finetune_model, inputs=finetune_input, outputs=finetune_output)
if __name__ == "__main__":
demo.launch()
|