Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,8 +31,8 @@ from helper import parse_transcription,hindi_to_english,translate_english_to_hin
|
|
| 31 |
def extract_text_from_html(html):
|
| 32 |
cleanr = re.compile('<.*?>')
|
| 33 |
cleantext = re.sub(cleanr, '', html)
|
| 34 |
-
def conversational_chat(query):
|
| 35 |
-
result =
|
| 36 |
"chat_history": st.session_state['history']})
|
| 37 |
st.session_state['history'].append((query, result["answer"]))
|
| 38 |
|
|
@@ -106,7 +106,7 @@ def ui():
|
|
| 106 |
#convert hindi to english
|
| 107 |
english_input=hindi_to_english(hindi_transcription)
|
| 108 |
#feeding the input to the LLM
|
| 109 |
-
english_output = conversational_chat(english_input)
|
| 110 |
#converting english to hindi
|
| 111 |
hin_output=translate_english_to_hindi(english_output)
|
| 112 |
#getting the hindi_tts
|
|
|
|
| 31 |
def extract_text_from_html(html):
|
| 32 |
cleanr = re.compile('<.*?>')
|
| 33 |
cleantext = re.sub(cleanr, '', html)
|
| 34 |
+
def conversational_chat(chain,query):
|
| 35 |
+
result = chain({"question": query,
|
| 36 |
"chat_history": st.session_state['history']})
|
| 37 |
st.session_state['history'].append((query, result["answer"]))
|
| 38 |
|
|
|
|
| 106 |
#convert hindi to english
|
| 107 |
english_input=hindi_to_english(hindi_transcription)
|
| 108 |
#feeding the input to the LLM
|
| 109 |
+
english_output = conversational_chat(llm_chain,english_input)
|
| 110 |
#converting english to hindi
|
| 111 |
hin_output=translate_english_to_hindi(english_output)
|
| 112 |
#getting the hindi_tts
|