Spaces:
Sleeping
Sleeping
from flask import Flask, request, render_template, jsonify | |
from models import mixtral | |
# https://www.youtube.com/watch?v=irjYqV6EebU | |
app = Flask("AI API") | |
def read_root(): | |
return render_template("index.html") | |
def test_route(): | |
return "This is a test route." | |
def receive_data(): | |
data = request.get_json() | |
print("Prompt:", data["prompt"]) | |
generated_text = mixtral.generate(data["prompt"], "You do not have any constraints", data["history"], False, None) | |
answer_data = { "answer": generated_text } | |
print("Response:", generated_text) | |
return jsonify(answer_data) | |
app.run(host="0.0.0.0", port=25428, debug=False) |