solnone commited on
Commit
2f0762a
1 Parent(s): ce649f8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -0
main.py CHANGED
@@ -104,6 +104,15 @@ from linebot.v3.insight import (
104
  Insight
105
  )
106
 
 
 
 
 
 
 
 
 
 
107
  app = Flask(__name__)
108
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
109
  app.logger.setLevel(logging.INFO)
@@ -741,6 +750,7 @@ def handle_text_message(event):
741
  else:
742
  chat = get_chat(event.source.user_id)
743
  response = chat.send_message(text)
 
744
  html_msg = markdown.markdown(response.text)
745
  soup = BeautifulSoup(html_msg, 'html.parser')
746
  line_bot_api.reply_message(
 
104
  Insight
105
  )
106
 
107
+ import requests
108
+
109
+ # HF_TOKEN = os.environ.get('HF_TOKEN')
110
+ # headers = {"Authorization": f"Bearer {HF_TOKEN}"}
111
+ # API_URL = "https://api-inference.huggingface.co/models/mistralai/Mixtral-8x7B-Instruct-v0.1"
112
+ # def query(payload):
113
+ # response = requests.post(API_URL, headers=headers, json=payload)
114
+ # return response.json()
115
+
116
  app = Flask(__name__)
117
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
118
  app.logger.setLevel(logging.INFO)
 
750
  else:
751
  chat = get_chat(event.source.user_id)
752
  response = chat.send_message(text)
753
+ # query({"inputs": input,"parameters":{"return_full_text":False,"max_length":1024}})
754
  html_msg = markdown.markdown(response.text)
755
  soup = BeautifulSoup(html_msg, 'html.parser')
756
  line_bot_api.reply_message(