Update app.py
Browse files
app.py
CHANGED
@@ -717,20 +717,16 @@ def advanced_text_generation(input_vector):
|
|
717 |
|
718 |
|
719 |
|
720 |
-
def chat():
|
721 |
print("FiPhi-NeuralMark ACC Initialized")
|
722 |
base_length = round(5 * PHI)
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
for word in user_input_tokens:
|
731 |
-
if word in word_to_index:
|
732 |
-
input_vector[word_to_index[word]] = 1
|
733 |
-
response = advanced_text_generation(input_vector)
|
734 |
|
735 |
demo = gr.ChatInterface(
|
736 |
fn=chat,
|
|
|
717 |
|
718 |
|
719 |
|
720 |
+
def chat(user_input):
|
721 |
print("FiPhi-NeuralMark ACC Initialized")
|
722 |
base_length = round(5 * PHI)
|
723 |
+
user_input_tokens = user_input.split()
|
724 |
+
input_vector = [0] * len(unique_words)
|
725 |
+
for word in user_input_tokens:
|
726 |
+
if word in word_to_index:
|
727 |
+
input_vector[word_to_index[word]] = 1
|
728 |
+
response = advanced_text_generation(input_vector)
|
729 |
+
return response
|
|
|
|
|
|
|
|
|
730 |
|
731 |
demo = gr.ChatInterface(
|
732 |
fn=chat,
|