Commit ·
3ee8645
1
Parent(s): 1d28e28
App update
Browse filesFiles changed (2)
- Dockerfile-2
- app.py+14-4
11 unmodified lines121314151617181911 unmodified lines# Install OllamaRUN curl -fsSL https://ollama.com/install.sh | shRUN ollama serve# Set up a new user named "user" with user ID 1000RUN useradd -m -u 1000 user11 unmodified lines12131415161711 unmodified lines# Install OllamaRUN curl -fsSL https://ollama.com/install.sh | sh# Set up a new user named "user" with user ID 1000RUN useradd -m -u 1000 user
1234565 unmodified lines1213141516171820 unmodified lines394041424344454647import gradio as grfrom ollama import chat, ChatResponseimport subprocessdef interact(message: str, history: list):message_dct = {5 unmodified lineschat_history.append(message_dct)response: ChatResponse = chat(model="deepseek-r1:1.5b",messages=chat_history,stream=True)20 unmodified linesinterface = gr.ChatInterface(fn=interact,type="messages",title="Deepseek-R1 Chat Interface")if __name__ == "__main__":subprocess.run(["ollama", "run", "deepseek-r1:1.5b"])interface.launch()1234567895 unmodified lines1516171819202120 unmodified lines42434445464748495051525354555657import gradio as grfrom ollama import chat, ChatResponseimport subprocessimport timemodel_id = "deepseek-r1:1.5b"def interact(message: str, history: list):message_dct = {5 unmodified lineschat_history.append(message_dct)response: ChatResponse = chat(model=model_id,messages=chat_history,stream=True)20 unmodified linesinterface = gr.ChatInterface(fn=interact,type="messages",title="Deepseek-R1 Chat Interface",description="Model: Deepseek R1: 1.5B params")if __name__ == "__main__":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