alanchen1115 commited on
Commit
0ea605e
Β·
verified Β·
1 Parent(s): 1b4d51f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -6
main.py CHANGED
@@ -1,6 +1,4 @@
1
  from flask import Flask, request, abort
2
- from flask_ngrok import run_with_ngrok # colab
3
- from llama_cpp import Llama
4
  import json
5
  import os
6
 
@@ -21,7 +19,6 @@ working_status = os.getenv("DEFALUT_TALKING", default = "true").lower() == "true
21
 
22
  app = Flask(__name__)
23
 
24
- llm = Llama(model_path="Breeze-7B-Instruct-v0.1-Q8_0.gguf", n_gpu_layers=32)
25
  line_handler = WebhookHandler(YOUR_CHANNEL_SECRET)
26
  line_bot_api = LineBotApi(YOUR_CHANNEL_ACCESS_TOKEN)
27
 
@@ -55,9 +52,7 @@ def handle_message(event):
55
  return
56
 
57
  if working_status:
58
- QA = f"HUMAN: {event.message.text}? ASSISTANT: "
59
- out = llm(QA, max_tokens=512, temperature = 0.5, echo=True)
60
- out = out['choices'][0]['text'].split('ASSISTANT:')[1]
61
  if not out:
62
  out = "δΈζ‡‚ζ‚¨ηš„ζ„ζ€!"
63
  line_bot_api.reply_message(
 
1
  from flask import Flask, request, abort
 
 
2
  import json
3
  import os
4
 
 
19
 
20
  app = Flask(__name__)
21
 
 
22
  line_handler = WebhookHandler(YOUR_CHANNEL_SECRET)
23
  line_bot_api = LineBotApi(YOUR_CHANNEL_ACCESS_TOKEN)
24
 
 
52
  return
53
 
54
  if working_status:
55
+ out = event.message.text
 
 
56
  if not out:
57
  out = "δΈζ‡‚ζ‚¨ηš„ζ„ζ€!"
58
  line_bot_api.reply_message(