Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -166,22 +166,22 @@ def generate(
|
|
166 |
)
|
167 |
|
168 |
if method == "Base":
|
169 |
-
|
170 |
elif method == "Prefix":
|
171 |
-
|
172 |
elif method == "Evo Prefix" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
173 |
-
|
174 |
elif method == "FFT" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
175 |
-
|
176 |
elif method == "Evo FFT" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
177 |
-
|
178 |
elif method == "Full Data FFT" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
179 |
-
|
180 |
elif method == "Evo Prefix" and library in ["LangChain", "LlamaIndex", "DSPy"]:
|
181 |
model = model_map["CS Evo Prefix"]
|
182 |
else:
|
183 |
output = ""
|
184 |
-
model.to(device)
|
185 |
input_ids = tokenizer(code, return_tensors="pt").to(device)
|
186 |
# generated_ids = model.generate(**input_ids, **generate_kwargs)
|
187 |
generated_ids = model.generate(**input_ids)
|
|
|
166 |
)
|
167 |
|
168 |
if method == "Base":
|
169 |
+
model = basemodel
|
170 |
elif method == "Prefix":
|
171 |
+
model = model_map[library + " Prefix"]
|
172 |
elif method == "Evo Prefix" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
173 |
+
model = model_map["Main Evo Prefix"]
|
174 |
elif method == "FFT" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
175 |
+
model = model_map[library + " FFT"]
|
176 |
elif method == "Evo FFT" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
177 |
+
model = model_map["Main Evo FFT"]
|
178 |
elif method == "Full Data FFT" and library in ["SQLModel", "SfePy", "MegEngine"]:
|
179 |
+
model = model_map["Main FD FFT"]
|
180 |
elif method == "Evo Prefix" and library in ["LangChain", "LlamaIndex", "DSPy"]:
|
181 |
model = model_map["CS Evo Prefix"]
|
182 |
else:
|
183 |
output = ""
|
184 |
+
# model.to(device)
|
185 |
input_ids = tokenizer(code, return_tensors="pt").to(device)
|
186 |
# generated_ids = model.generate(**input_ids, **generate_kwargs)
|
187 |
generated_ids = model.generate(**input_ids)
|