|
import gradio as gr |
|
import torch |
|
|
|
|
|
with gr.Blocks(title="Simple Qwen Test") as demo: |
|
gr.Markdown("# Simple Qwen Test") |
|
gr.Markdown("This is a minimal test to check if the Space is working.") |
|
|
|
with gr.Tab("Basic Test"): |
|
with gr.Row(): |
|
with gr.Column(): |
|
test_button = gr.Button("Run Basic Test") |
|
with gr.Column(): |
|
test_result = gr.Textbox(label="Test Results", lines=10) |
|
|
|
def basic_test(): |
|
try: |
|
|
|
import sys |
|
import transformers |
|
|
|
result = [] |
|
result.append(f"Python version: {sys.version}") |
|
result.append(f"PyTorch version: {torch.__version__}") |
|
result.append(f"Transformers version: {transformers.__version__}") |
|
result.append("Basic test successful!") |
|
|
|
return "\n".join(result) |
|
except Exception as e: |
|
import traceback |
|
return f"Error: {str(e)}\n\n{traceback.format_exc()}" |
|
|
|
test_button.click( |
|
fn=basic_test, |
|
inputs=[], |
|
outputs=[test_result] |
|
) |
|
|
|
|
|
demo.launch() |