Spaces:
Runtime error
Runtime error
File size: 485 Bytes
a6affd6 a2fe63b a6affd6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from flask import Flask, request
from flask_cors import CORS, cross_origin
from ChatService import ChatService
import os
os.environ['TRANSFORMERS_CACHE'] = './cache/'
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './cache/'
app = Flask(__name__)
CORS(app)
chatService = ChatService()
chatService.load_model("collinear-ai/llama-2-7b-chat-fin")
@app.route("/chat", methods=['POST'])
@cross_origin(origin='*')
def hello_world():
return chatService.generate_message(request.get_json()) |