CoolFace
Apppublic

singh5587/telegram-bot1

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
0likes
app.py25 linesDownload Raw Back to root
1import requests2from flask import Flask3import os4 5 6app = Flask(__name__)7 8 9@app.route('/')10def get_gpt_response(text):11 12    r = requests.post(13        url="https://hf.space/embed/singh5587/gpt-j-6b/+/api/predict ",14        json={"data": [text]},15    )16    response = r.json()17    return response["data"][0]18 19 20get_gpt_response('hello')21 22 23 24if __name__ == "__main__":25    app.run()