VatsaDev commited on
Commit
5ef5b00
1 Parent(s): 5f02409

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -2,9 +2,11 @@ import os
2
  import requests
3
  from flask import Flask, render_template, request
4
  from llama_cpp import Llama
 
 
5
 
6
- llm = Llama(model_path="model.gguf", n_ctx=2048)
7
- app = Flask(__name__, template_folder='')
8
 
9
  @app.route("/")
10
  def home():
@@ -17,4 +19,5 @@ def respond():
17
  output = llm(input, max_tokens=maxTok, stop=["<|im_end|>"], echo=True)
18
  return output['choices'][0]['text']
19
 
20
- app.run()
 
 
2
  import requests
3
  from flask import Flask, render_template, request
4
  from llama_cpp import Llama
5
+ from dotenv import load_dotenv
6
+ load_dotenv()
7
 
8
+ llm = Llama(model_path="./model.gguf", n_ctx=2048)
9
+ app = Flask(__name__, template_folder='./')
10
 
11
  @app.route("/")
12
  def home():
 
19
  output = llm(input, max_tokens=maxTok, stop=["<|im_end|>"], echo=True)
20
  return output['choices'][0]['text']
21
 
22
+ if __name__ == '__main__':
23
+ app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))