Commit ·
3ee8645
1
Parent(s): 1d28e28
App update
Browse filesFiles changed (2)
- Dockerfile-2
- app.py+14-4
11 unmodified lines121314151615161711 unmodified lines# Install OllamaRUN curl -fsSL https://ollama.com/install.sh | sh
RUN ollama serve
# Set up a new user named "user" with user ID 1000RUN useradd -m -u 1000 user
1234567895 unmodified lines151617151819202120 unmodified lines42434442454647484946475051525354555657import gradio as grfrom ollama import chat, ChatResponseimport subprocessimport time
model_id = "deepseek-r1:1.5b"
def interact(message: str, history: list): message_dct = {5 unmodified lines chat_history.append(message_dct)
response: ChatResponse = chat( model="deepseek-r1:1.5b", model=model_id, messages=chat_history, stream=True )20 unmodified linesinterface = gr.ChatInterface( fn=interact, type="messages", title="Deepseek-R1 Chat Interface" title="Deepseek-R1 Chat Interface", description="Model: Deepseek R1: 1.5B params")
if __name__ == "__main__": subprocess.run(["ollama", "run", "deepseek-r1:1.5b"]) interface.launch() print("\n\nStarting Ollama...\n\n") subprocess.Popen(["ollama", "serve"]) time.sleep(10) print("\n\nOllama started successfully!!\n\n\n\nTesting...\n\n") subprocess.run(["ollama", "pull", model_id]) time.sleep(5) print("\n\nDeepseek-R1 started successfully!!\n\n") interface.launch(server_name="0.0.0.0", server_port=7860)Dockerfile-2
app.py+14-4