Logeswaransr commited on
Commit
2697443
·
1 Parent(s): 284bb1e

App.py Update

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -1
  2. app.py +8 -10
  3. requirements.txt +1 -1
Dockerfile CHANGED
@@ -28,4 +28,4 @@ WORKDIR $HOME/app
28
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
29
  COPY --chown=user . $HOME/app
30
 
31
- CMD ["python", "app.py"]
 
28
  # Copy the current directory contents into the container at $HOME/app setting the owner to the user
29
  COPY --chown=user . $HOME/app
30
 
31
+ CMD ["python", "-u", "app.py"]
app.py CHANGED
@@ -10,7 +10,6 @@ def interact(message: str, history: list):
10
  "role": "user",
11
  "content": message
12
  }
13
-
14
  chat_history = [msg for msg in history]
15
  chat_history.append(message_dct)
16
 
@@ -33,12 +32,11 @@ interface = gr.ChatInterface(
33
  description="Model: Microsoft Phi-2 (2.7B params)"
34
  )
35
 
36
- if __name__ == "__main__":
37
- print("\n\nStarting Ollama...\n\n")
38
- subprocess.Popen(["ollama", "serve"])
39
- time.sleep(10)
40
- print("\n\nOllama started successfully!!\n\n\n\nTesting...\n\n")
41
- subprocess.run(["ollama", "pull", model_id])
42
- time.sleep(5)
43
- print("\n\nMicrosoft Phi-2 started successfully!!\n\n")
44
- interface.launch(server_name="0.0.0.0", server_port=7860)
 
10
  "role": "user",
11
  "content": message
12
  }
 
13
  chat_history = [msg for msg in history]
14
  chat_history.append(message_dct)
15
 
 
32
  description="Model: Microsoft Phi-2 (2.7B params)"
33
  )
34
 
35
+ print("\n\nStarting Ollama...\n\n")
36
+ subprocess.Popen(["ollama", "serve"])
37
+ time.sleep(10)
38
+ print("\n\nOllama started successfully!!\n\n\n\nTesting...\n\n")
39
+ subprocess.run(["ollama", "pull", model_id])
40
+ time.sleep(5)
41
+ print("\n\nMicrosoft Phi-2 started successfully!!\n\n")
42
+ interface.launch(server_name="0.0.0.0", server_port=7860)
 
requirements.txt CHANGED
@@ -1,2 +1,2 @@
1
  ollama
2
- gradio
 
1
  ollama
2
+ gradio==5.14.0