Download src/streamlit_app.py from azilll/Jari: direct link, hf CLI and curl.
- Browser
- Download file 466 Bytes
-
https://huggingface.co/spaces/azilll/Jari/resolve/main/src/streamlit_app.py
- Command line
-
hf download hf://spaces/azilll/Jari/src/streamlit_app.py
-
curl -L -o streamlit_app.py https://huggingface.co/spaces/azilll/Jari/resolve/main/src/streamlit_app.py
466 Bytes
| from transformers import pipeline | |
| import gradio as gr | |
| # Load chatbot model (offline-friendly, no OpenAI) | |
| chat = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.2", max_new_tokens=200) | |
| def jari_chat(user_input): | |
| prompt = f"[INST] {user_input} [/INST]" | |
| response = chat(prompt)[0]["generated_text"] | |
| return response[len(prompt):].strip() | |
| gr.Interface(fn=jari_chat, inputs="text", outputs="text", title="Jari - Coding Chatbot").launch() |