TejAndrewsACC commited on
Commit
970b85b
·
verified ·
1 Parent(s): c8a2ac4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -12
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
- while True:
724
- user_input = input("\nYou: ")
725
- if user_input.lower() == "exit":
726
- print("Goodbye!")
727
- break
728
- user_input_tokens = user_input.split()
729
- input_vector = [0] * len(unique_words)
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,