abhicodes commited on
Commit
9a30354
·
1 Parent(s): 56e0ac7

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +0 -2
  2. app.py +0 -16
Dockerfile CHANGED
@@ -6,8 +6,6 @@ COPY ./requirements.txt /code/requirements.txt
6
 
7
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
8
 
9
- RUN pip install g4f
10
-
11
  COPY . /code
12
 
13
  CMD ["gunicorn", "app:app", "-b", "0.0.0.0:8000"]
 
6
 
7
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
8
 
 
 
9
  COPY . /code
10
 
11
  CMD ["gunicorn", "app:app", "-b", "0.0.0.0:8000"]
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import string
2
  import random
3
- import g4f
4
  from flask import Flask, render_template, jsonify, request
5
  from flask_cors import CORS
6
 
@@ -145,20 +144,5 @@ def groupchat():
145
  return jsonify({'success': True, 'chats': group_chat['chats']})
146
 
147
 
148
- @app.route('/chat-bot', methods=['POST'])
149
- def chatbot():
150
- if request.method == 'POST':
151
- data = request.get_json()
152
- query = data.get('query')
153
-
154
- response = g4f.ChatCompletion.create(
155
- model="gpt-3.5-turbo",
156
- provider=g4f.Provider.Hashnode,
157
- messages=[{"role": "user", "content": query}],
158
- )
159
-
160
- return jsonify({'success': True, 'response': '#' + str(response)[1:]})
161
-
162
-
163
  if __name__ == '__main__':
164
  app.run(debug=True, host='0.0.0.0')
 
1
  import string
2
  import random
 
3
  from flask import Flask, render_template, jsonify, request
4
  from flask_cors import CORS
5
 
 
144
  return jsonify({'success': True, 'chats': group_chat['chats']})
145
 
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  if __name__ == '__main__':
148
  app.run(debug=True, host='0.0.0.0')