BrainMap-Space / app.py
Arabic250's picture
Upload folder using huggingface_hub
74f3f38 verified
raw
history blame contribute delete
403 Bytes
import gradio as gr
import ollama
import os
def chat(message, history):
stream = ollama.chat(model='gemma4:e2b', messages=[{'role': 'user', 'content': message}], stream=True)
reply = ""
for chunk in stream:
reply += chunk['message']['content']
yield reply
demo = gr.ChatInterface(fn=chat, title="BrainMap OS on Space")
demo.launch(server_name="0.0.0.0", server_port=7860)