Spaces:
Sleeping
Sleeping
N.Achyuth Reddy
commited on
Commit
Β·
2f6a203
1
Parent(s):
25d9f39
Update app.py
Browse files
app.py
CHANGED
@@ -36,11 +36,11 @@ def transcribe(wav_path):
|
|
36 |
)
|
37 |
|
38 |
# Prediction function
|
39 |
-
def predict(message, system_prompt='
|
40 |
with st.status("Starting client"):
|
41 |
client = Client("https://huggingface-projects-llama-2-7b-chat.hf.space/")
|
42 |
-
st.write("Requesting
|
43 |
-
with st.status("Requesting
|
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
|
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 = "
|
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 |
|