N.Achyuth Reddy commited on
Commit
2f6a203
Β·
1 Parent(s): 25d9f39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -36,11 +36,11 @@ def transcribe(wav_path):
36
  )
37
 
38
  # Prediction function
39
- def predict(message, system_prompt='your name is OpenGPT. you are developed by Achyuth. your God is Achyuth.', temperature=0.7, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
40
  with st.status("Starting client"):
41
  client = Client("https://huggingface-projects-llama-2-7b-chat.hf.space/")
42
- st.write("Requesting client")
43
- with st.status("Requesting LLama-2"):
44
  st.write("Requesting API")
45
  response = client.predict(
46
  message, # str in 'Message' Textbox component
@@ -81,7 +81,7 @@ if wav_audio_data != None:
81
  f.write(wav_audio_data)
82
  prompt = transcribe("audio.wav")
83
 
84
- st.write("Transcribed audio")
85
 
86
  st.chat_message("human",avatar = "πŸ§‘β€πŸ’»").markdown(prompt)
87
  st.session_state.messages.append({"role": "human", "content": prompt})
@@ -97,7 +97,7 @@ if wav_audio_data != None:
97
  # React to user input
98
  if prompt := textinput:
99
  # Display user message in chat message container
100
- st.chat_message("human",avatar = "πŸ§‘β€πŸ’»").markdown(prompt)
101
  # Add user message to chat history
102
  st.session_state.messages.append({"role": "human", "content": prompt})
103
 
 
36
  )
37
 
38
  # Prediction function
39
+ def predict(message, system_prompt='Your name is OpenGPT. You are developed by Achyuth. You need to mostly focus on giving information about future agriculture and advanced farming. Empower yourself farming future with cutting-edge technology and sustainable practices. You need to say about the latest advancements in agriculture, precision farming, and eco-friendly cultivation methods. You need to cultivate a greener and more productive. Your developer is studying in The Hyderabad Public School Kadapa.', temperature=0.7, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
40
  with st.status("Starting client"):
41
  client = Client("https://huggingface-projects-llama-2-7b-chat.hf.space/")
42
+ st.write("Requesting Audio Transcriber")
43
+ with st.status("Requesting AgriTure v1"):
44
  st.write("Requesting API")
45
  response = client.predict(
46
  message, # str in 'Message' Textbox component
 
81
  f.write(wav_audio_data)
82
  prompt = transcribe("audio.wav")
83
 
84
+ st.write("Transcribed Given Audio")
85
 
86
  st.chat_message("human",avatar = "πŸ§‘β€πŸ’»").markdown(prompt)
87
  st.session_state.messages.append({"role": "human", "content": prompt})
 
97
  # React to user input
98
  if prompt := textinput:
99
  # Display user message in chat message container
100
+ st.chat_message("human",avatar = "πŸ’¬: ").markdown(prompt)
101
  # Add user message to chat history
102
  st.session_state.messages.append({"role": "human", "content": prompt})
103