Th3BossC commited on
Commit
7cd3162
1 Parent(s): cbd2842

fixed runtime error

Browse files
ChitChat/common/utils.py CHANGED
@@ -13,8 +13,8 @@ small_model = AutoModelForCausalLM.from_pretrained(small_model_name)
13
  small_tokenizer = AutoTokenizer.from_pretrained(default_model)
14
  small_tokenizer.pad_token = small_tokenizer.eos_token
15
 
16
- large_model = T5ForConditionalGeneration.from_pretrained(large_model_name)
17
- large_tokenizer = T5Tokenizer.from_pretrained(large_model_name)
18
 
19
  def getChatHistory(user):
20
  if user.history is None:
@@ -57,6 +57,7 @@ def conversation(user, userInput):
57
  return small_tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens = True)
58
 
59
  def complexChat(userInput):
 
60
  input_ids = large_tokenizer(userInput, return_tensors="pt").input_ids
61
  outputs = large_model.generate(input_ids,
62
  min_length = 10,
 
13
  small_tokenizer = AutoTokenizer.from_pretrained(default_model)
14
  small_tokenizer.pad_token = small_tokenizer.eos_token
15
 
16
+ # large_model = T5ForConditionalGeneration.from_pretrained(large_model_name)
17
+ # large_tokenizer = T5Tokenizer.from_pretrained(large_model_name)
18
 
19
  def getChatHistory(user):
20
  if user.history is None:
 
57
  return small_tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens = True)
58
 
59
  def complexChat(userInput):
60
+ return "hi"
61
  input_ids = large_tokenizer(userInput, return_tensors="pt").input_ids
62
  outputs = large_model.generate(input_ids,
63
  min_length = 10,
ChitChat/models.py CHANGED
@@ -1,14 +1,9 @@
1
  from ChitChat import db
2
  from datetime import datetime
3
  import uuid
4
- from flask_login import UserMixin
5
- from ChitChat import login_manager
6
 
7
- @login_manager.user_loader
8
- def load_user(user_id):
9
- return User.query.get(int(user_id))
10
 
11
- class User(db.Model, UserMixin):
12
  id = db.Column(db.Integer, primary_key = True)
13
  username = db.Column(db.String(10), unique = True, nullable = False)
14
  email = db.Column(db.String(100), nullable = False)
 
1
  from ChitChat import db
2
  from datetime import datetime
3
  import uuid
 
 
4
 
 
 
 
5
 
6
+ class User(db.Model):
7
  id = db.Column(db.Integer, primary_key = True)
8
  username = db.Column(db.String(10), unique = True, nullable = False)
9
  email = db.Column(db.String(100), nullable = False)
instance/site.db CHANGED
Binary files a/instance/site.db and b/instance/site.db differ
 
requirements.txt CHANGED
@@ -9,7 +9,6 @@ filelock==3.12.2
9
  Flask==2.3.2
10
  Flask-Bcrypt==1.0.1
11
  Flask-Cors==3.0.10
12
- Flask-Login==0.6.2
13
  Flask-RESTful==0.3.10
14
  Flask-SQLAlchemy==3.0.3
15
  fsspec==2023.6.0
 
9
  Flask==2.3.2
10
  Flask-Bcrypt==1.0.1
11
  Flask-Cors==3.0.10
 
12
  Flask-RESTful==0.3.10
13
  Flask-SQLAlchemy==3.0.3
14
  fsspec==2023.6.0