Jari / src /streamlit_app.py
azilll's picture
Update src/streamlit_app.py
2acb512 verified
Raw History Blame Contribute Delete
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()