Ron Au commited on
Commit
a1d85fa
1 Parent(s): d3a278d

Merge start script with Python app_file

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. startserver.sh +0 -5
app.py CHANGED
@@ -30,9 +30,6 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
30
  logger = create_logger(__name__)
31
 
32
  # Load the auth-token from authtoken.txt.
33
- # auth_token = None
34
- # with open("authtoken.txt", "r") as authtoken_file:
35
- # auth_token = authtoken_file.read().strip()
36
  auth_token = os.getenv("authtoken")
37
 
38
  # Loading the model and its tokenizer.
@@ -141,3 +138,6 @@ def generate_sequence(instruments, density, temperature):
141
 
142
  generated_sequence = tokenizer.decode(generated_ids)
143
  return generated_sequence
 
 
 
 
30
  logger = create_logger(__name__)
31
 
32
  # Load the auth-token from authtoken.txt.
 
 
 
33
  auth_token = os.getenv("authtoken")
34
 
35
  # Loading the model and its tokenizer.
 
138
 
139
  generated_sequence = tokenizer.decode(generated_ids)
140
  return generated_sequence
141
+
142
+ if __name__ == "__main__":
143
+ app.run(host="0.0.0.0", port=7860)
startserver.sh DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/sh
2
-
3
- export FLASK_ENV=development
4
- export FLASK_DEBUG=1
5
- flask run