Spaces:
Build error

ROOB-Falcon-api / app.py
wiseproffit's picture
Create app.py
48738dd verified
Raw History Blame Contribute Delete
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()