MandlaZwane commited on
Commit
6e45523
·
verified ·
1 Parent(s): 6382163

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -1,4 +1,3 @@
1
- # Import necessary libraries
2
  from flask import Flask, request, jsonify, render_template
3
  import sys
4
  import os
@@ -92,13 +91,17 @@ def home():
92
  def generate():
93
  user_input = request.form['user_input']
94
  try:
95
- if "urname" in user_input and "what" in user_input or \
96
- "your name" in user_input and "what" in user_input or \
97
- "tell " in user_input and "your name" in user_input or \
98
- "what" in user_input and "you go by" in user_input or \
99
- "what" in user_input and "call yourself" in user_input or \
100
- "what" in user_input and "you called?" in user_input or \
101
- "what" in user_input and "they call you" in user_input:
 
 
 
 
102
  response_text = "I am Shanks, a large language model developed by Motaung.inc"
103
  else:
104
  response_text = generate_text(model, tokenizer, user_input)
@@ -107,4 +110,5 @@ def generate():
107
  return jsonify({"error": str(e)}), 500
108
 
109
  if __name__ == '__main__':
110
- app.run(debug=True, port=7860)
 
 
 
1
  from flask import Flask, request, jsonify, render_template
2
  import sys
3
  import os
 
91
  def generate():
92
  user_input = request.form['user_input']
93
  try:
94
+ if "urname" in user_input and "what" in user_input:
95
+ response_text = "I am Shanks, a large language model developed by Motaung.inc"
96
+ elif "your name" in user_input and "what" in user_input:
97
+ response_text = "I am Shanks, a large language model developed by Motaung.inc"
98
+ elif "tell " in user_input and "your name" in user_input:
99
+ response_text = "I am Shanks, a large language model developed by Motaung.inc"
100
+ elif "what" in user_input and "you go by" in user_input:
101
+ response_text = "I am Shanks, a large language model developed by Motaung.inc"
102
+ elif "what" in user_input and "call yourself" in user_input:
103
+ response_text = "I am Shanks, a large language model developed by Motaung.inc"
104
+ elif "what" in user_input and "they call you" in user_input:
105
  response_text = "I am Shanks, a large language model developed by Motaung.inc"
106
  else:
107
  response_text = generate_text(model, tokenizer, user_input)
 
110
  return jsonify({"error": str(e)}), 500
111
 
112
  if __name__ == '__main__':
113
+ from gunicorn.app.wsgiapp import run
114
+ run()