root commited on
Commit
a1f97de
·
1 Parent(s): 653e0d6
Files changed (3) hide show
  1. app.py +15 -0
  2. explanation_generator.py +15 -0
  3. requirements.txt +0 -1
app.py CHANGED
@@ -33,6 +33,21 @@ EMBEDDING_MODEL_NAME = "nvidia/NV-Embed-v2"
33
  print(f"Loading embedding model {EMBEDDING_MODEL_NAME}...")
34
 
35
  try:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  # Load embedding model and tokenizer
37
  global_embedding_tokenizer = AutoTokenizer.from_pretrained(EMBEDDING_MODEL_NAME, trust_remote_code=True)
38
  global_embedding_model = AutoModel.from_pretrained(EMBEDDING_MODEL_NAME, trust_remote_code=True, device_map="auto")
 
33
  print(f"Loading embedding model {EMBEDDING_MODEL_NAME}...")
34
 
35
  try:
36
+ # Create a simple Replicate class since it's missing
37
+ class Replicate(torch.nn.Module):
38
+ def __init__(self):
39
+ super().__init__()
40
+
41
+ def forward(self, x):
42
+ return x
43
+
44
+ # Add to global namespace to make it available
45
+ import sys
46
+ sys.modules['__main__'].Replicate = Replicate
47
+
48
+ # Also add to globals
49
+ globals()['Replicate'] = Replicate
50
+
51
  # Load embedding model and tokenizer
52
  global_embedding_tokenizer = AutoTokenizer.from_pretrained(EMBEDDING_MODEL_NAME, trust_remote_code=True)
53
  global_embedding_model = AutoModel.from_pretrained(EMBEDDING_MODEL_NAME, trust_remote_code=True, device_map="auto")
explanation_generator.py CHANGED
@@ -17,6 +17,21 @@ print("Loading Qwen/QwQ-32B model with 4-bit quantization...")
17
  QWQ_MODEL_NAME = "Qwen/QwQ-32B"
18
 
19
  try:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  # Configure 4-bit quantization for better performance
21
  quantization_config = BitsAndBytesConfig(
22
  load_in_4bit=True,
 
17
  QWQ_MODEL_NAME = "Qwen/QwQ-32B"
18
 
19
  try:
20
+ # Create a simple Replicate class since it's missing
21
+ class Replicate(torch.nn.Module):
22
+ def __init__(self):
23
+ super().__init__()
24
+
25
+ def forward(self, x):
26
+ return x
27
+
28
+ # Add to global namespace to make it available
29
+ import sys
30
+ sys.modules['__main__'].Replicate = Replicate
31
+
32
+ # Also add to globals
33
+ globals()['Replicate'] = Replicate
34
+
35
  # Configure 4-bit quantization for better performance
36
  quantization_config = BitsAndBytesConfig(
37
  load_in_4bit=True,
requirements.txt CHANGED
@@ -18,4 +18,3 @@ huggingface-hub>=0.30.0,<1.0
18
  einops
19
  bitsandbytes>=0.41.0
20
  accelerate>=0.23.0
21
- replicate==0.17.0
 
18
  einops
19
  bitsandbytes>=0.41.0
20
  accelerate>=0.23.0