Spaces:
Sleeping
Sleeping
Download app.py from Asssident/circuit-debugger-ai: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/spaces/Asssident/circuit-debugger-ai/resolve/main/app.py
- Command line
-
hf download hf://spaces/Asssident/circuit-debugger-ai/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Asssident/circuit-debugger-ai/resolve/main/app.py
566 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Load the AI model | |
| model = pipeline("text-generation", model="STEM-AI-mtl/phi-2-electrical-engineering") | |
| # Function to process user questions | |
| def get_ai_answer(question): | |
| response = model(question, max_length=200, do_sample=True) | |
| return response[0]["generated_text"] | |
| # Gradio UI | |
| iface = gr.Interface( | |
| fn=get_ai_answer, | |
| inputs="text", | |
| outputs="text", | |
| title="Circuit Debugging AI", | |
| description="Ask electrical engineering or circuit debugging questions!" | |
| ) | |
| # Launch | |
| iface.launch() | |