Spaces:
Build error
Build error
Download app.py from LONELYDEVELOPER/ROOB-Falcon-api: direct link, hf CLI and curl.
- Browser
- Download file 587 Bytes
-
https://huggingface.co/spaces/LONELYDEVELOPER/ROOB-Falcon-api/resolve/main/app.py
- Command line
-
hf download hf://spaces/LONELYDEVELOPER/ROOB-Falcon-api/app.py
-
curl -L -o app.py https://huggingface.co/spaces/LONELYDEVELOPER/ROOB-Falcon-api/resolve/main/app.py
587 Bytes
| import gradio as gr | |
| import subprocess | |
| # Funktion für das Modell | |
| def generate_response(prompt): | |
| result = subprocess.run( | |
| ["./llama.cpp/main", "-m", "/models/Falcon3-7B-Instruct-q4_0.gguf", "-p", prompt], | |
| capture_output=True, text=True | |
| ) | |
| return result.stdout | |
| # Gradio Interface | |
| iface = gr.Interface( | |
| fn=generate_response, | |
| inputs=gr.Textbox(label="Eingabe"), | |
| outputs=gr.Textbox(label="Antwort"), | |
| title="Falcon 7B Chatbot", | |
| description="Gib eine Eingabe ein und erhalte eine Antwort vom Falcon 7B GGUF-Modell." | |
| ) | |
| # Starten | |
| iface.launch() | |