phildunphy14 commited on
Commit
20444e3
·
verified ·
1 Parent(s): 0346a40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -18
app.py CHANGED
@@ -7,15 +7,6 @@ import subprocess
7
  import requests
8
  from bs4 import BeautifulSoup
9
 
10
- from flask import Flask
11
- app = Flask(__name__)
12
-
13
- @app.route('/')
14
- def home():
15
- return "Server is running"
16
-
17
- if __name__ == '__main__':
18
- app.run(host='localhost', port=5000)
19
 
20
  # def ollama():
21
  # os.environ['OLLAMA_HOST'] = '0.0.0.0:11434'
@@ -180,20 +171,34 @@ st.set_page_config(page_title="Affirmations", page_icon=":muscle:", layout="wide
180
  # st.markdown(f'<div class="affirmation-box"><p class="affirmation-text">{affirmation}</p></div>', unsafe_allow_html=True)
181
 
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  from langchain_community.llms import Ollama
 
 
184
  llm = Ollama(model="llama3")
185
 
186
- prompt = '''My name is aditi, i have 2 pets named Jamun and Misri and i do not like going to gym because i expect results too quickly\n
187
- In few days i see no gains and get irritated and give up. This time around i have decided to take it slow and \n
188
- do it more for feeling better, reduce resting heart rate, overall feeling fitter little bit everyday.\n
189
- Taking all this above context , Your job is to give me positive affirmations like taylor swift would talk to me in the theme of starting with fewn lines about my horoscope and then talk about my fitness goals.\n
190
- Try to include taylor swift song lyrics in few places not forcefully but relevant to the overall content. \n
191
- I don\'t want output to use exactly these words i have written so that it does not feel fake or forceful.\n
192
- The structure should be conversational like taylor swift talking to me about my life and pets and not bullet points or third person.'''
193
 
194
- import os
195
  response = llm.invoke(prompt)
196
 
 
197
  st.markdown(response)
198
 
199
 
@@ -202,4 +207,3 @@ st.markdown(response)
202
 
203
 
204
 
205
-
 
7
  import requests
8
  from bs4 import BeautifulSoup
9
 
 
 
 
 
 
 
 
 
 
10
 
11
  # def ollama():
12
  # os.environ['OLLAMA_HOST'] = '0.0.0.0:11434'
 
171
  # st.markdown(f'<div class="affirmation-box"><p class="affirmation-text">{affirmation}</p></div>', unsafe_allow_html=True)
172
 
173
 
174
+ # from langchain_community.llms import Ollama
175
+ # llm = Ollama(model="llama3")
176
+
177
+ # prompt = '''My name is aditi, i have 2 pets named Jamun and Misri and i do not like going to gym because i expect results too quickly\n
178
+ # In few days i see no gains and get irritated and give up. This time around i have decided to take it slow and \n
179
+ # do it more for feeling better, reduce resting heart rate, overall feeling fitter little bit everyday.\n
180
+ # Taking all this above context , Your job is to give me positive affirmations like taylor swift would talk to me in the theme of starting with fewn lines about my horoscope and then talk about my fitness goals.\n
181
+ # Try to include taylor swift song lyrics in few places not forcefully but relevant to the overall content. \n
182
+ # I don\'t want output to use exactly these words i have written so that it does not feel fake or forceful.\n
183
+ # The structure should be conversational like taylor swift talking to me about my life and pets and not bullet points or third person.'''
184
+
185
+ # import os
186
+ # response = llm.invoke(prompt)
187
+
188
+ # st.markdown(response)
189
+
190
  from langchain_community.llms import Ollama
191
+
192
+ # Initialize the Ollama model
193
  llm = Ollama(model="llama3")
194
 
195
+ # Define your prompt
196
+ prompt = '''tell me a joke.'''
 
 
 
 
 
197
 
198
+ # Invoke the model with your prompt
199
  response = llm.invoke(prompt)
200
 
201
+ # Display the response in your Streamlit app
202
  st.markdown(response)
203
 
204
 
 
207
 
208
 
209