Spaces:
Runtime error
Runtime error
Download app.py from Replicable/SEYFOR_ALPHA: direct link, hf CLI and curl.
- Browser
- Download file 394 Bytes
-
https://huggingface.co/spaces/Replicable/SEYFOR_ALPHA/resolve/main/app.py
- Command line
-
hf download hf://spaces/Replicable/SEYFOR_ALPHA/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Replicable/SEYFOR_ALPHA/resolve/main/app.py
394 Bytes
| import gradio as gr | |
| from llama_cpp import Llama | |
| # Načtení modelu (nutné stáhnout GGUF verzi) | |
| MODEL_PATH = "llama-2-7b.Q4_K_M.gguf" | |
| llm = Llama(model_path=MODEL_PATH) | |
| # Funkce pro odpovědi | |
| def chat(prompt): | |
| response = llm(prompt, max_tokens=100) | |
| return response["choices"][0]["text"] | |
| # Gradio UI | |
| interface = gr.Interface(fn=chat, inputs="text", outputs="text") | |
| interface.launch() |