TeleologyHI commited on
Commit
2e4c7ad
·
1 Parent(s): 54b77be
app.py CHANGED
@@ -9,7 +9,7 @@ def initialize_model():
9
  model_config = HIMConfig()
10
  env_config = EnvironmentConfig()
11
  device = torch.device("cuda" if torch.cuda.is_available() and env_config.device == "cuda" else "cpu")
12
- model = HIMModel(model_config).to(device) # Pass model_config directly instead of model_config.to_dict()
13
  return model
14
 
15
  async def chat(message: str,
 
9
  model_config = HIMConfig()
10
  env_config = EnvironmentConfig()
11
  device = torch.device("cuda" if torch.cuda.is_available() and env_config.device == "cuda" else "cpu")
12
+ model = HIMModel(model_config.to_dict()).to(device)
13
  return model
14
 
15
  async def chat(message: str,
config/environment_config.py CHANGED
@@ -1,10 +1,6 @@
1
- from dataclasses import dataclass
2
- from typing import Optional
3
-
4
- @dataclass
5
  class EnvironmentConfig:
6
  def __init__(self):
7
- self.device = "cuda" # or "cpu"
8
  self.log_level = "INFO"
9
  self.api_port = 8000
10
  self.threads = 4
 
 
 
 
 
1
  class EnvironmentConfig:
2
  def __init__(self):
3
+ self.device = "cuda" # ou "cpu"
4
  self.log_level = "INFO"
5
  self.api_port = 8000
6
  self.threads = 4
config/model_config.py CHANGED
@@ -1,7 +1,3 @@
1
- from dataclasses import dataclass
2
- from typing import Dict, List
3
-
4
- @dataclass
5
  class HIMConfig:
6
  def __init__(self):
7
  self.base_model = "gpt2-medium"
 
 
 
 
 
1
  class HIMConfig:
2
  def __init__(self):
3
  self.base_model = "gpt2-medium"