Spaces:
Running
Running
Commit
·
204586a
1
Parent(s):
b3c8f69
made few changes
Browse files- __pycache__/app.cpython-39.pyc +0 -0
- __pycache__/configs.cpython-39.pyc +0 -0
- __pycache__/models.cpython-39.pyc +0 -0
- __pycache__/utils.cpython-39.pyc +0 -0
- app.py +5 -2
__pycache__/app.cpython-39.pyc
ADDED
Binary file (5.16 kB). View file
|
|
__pycache__/configs.cpython-39.pyc
CHANGED
Binary files a/__pycache__/configs.cpython-39.pyc and b/__pycache__/configs.cpython-39.pyc differ
|
|
__pycache__/models.cpython-39.pyc
CHANGED
Binary files a/__pycache__/models.cpython-39.pyc and b/__pycache__/models.cpython-39.pyc differ
|
|
__pycache__/utils.cpython-39.pyc
CHANGED
Binary files a/__pycache__/utils.cpython-39.pyc and b/__pycache__/utils.cpython-39.pyc differ
|
|
app.py
CHANGED
@@ -3,6 +3,7 @@ from fastapi.responses import HTMLResponse, RedirectResponse, JSONResponse
|
|
3 |
from pydantic import BaseModel
|
4 |
from typing import List
|
5 |
import os # ← add this
|
|
|
6 |
from clearml import Model, Task
|
7 |
import torch
|
8 |
from configs import add_args
|
@@ -11,6 +12,9 @@ import argparse
|
|
11 |
from argparse import Namespace
|
12 |
from peft import PeftModel, PeftConfig, get_peft_model, LoraConfig
|
13 |
|
|
|
|
|
|
|
14 |
# Load endpoints & creds
|
15 |
CLEARML_API_HOST = os.environ["CLEARML_API_HOST"]
|
16 |
CLEARML_WEB_HOST = os.environ["CLEARML_WEB_HOST"]
|
@@ -66,8 +70,7 @@ print("Base model architecture and tokenizer loaded.")
|
|
66 |
# Download the fine-tuned weights via ClearML using your injected creds
|
67 |
task = Task.get_task(task_id="9cc33fb4d1d54378b691188c5e230253")
|
68 |
finetuned_weights_path = task.artifacts["lora-pytorch-bin"].get_local_copy()
|
69 |
-
|
70 |
-
print(f"Fine-tuned adapter weights downloaded to directory: {adapter_dir}")
|
71 |
|
72 |
# Create LoRA configuration matching the fine-tuned checkpoint
|
73 |
lora_cfg = LoraConfig(
|
|
|
3 |
from pydantic import BaseModel
|
4 |
from typing import List
|
5 |
import os # ← add this
|
6 |
+
|
7 |
from clearml import Model, Task
|
8 |
import torch
|
9 |
from configs import add_args
|
|
|
12 |
from argparse import Namespace
|
13 |
from peft import PeftModel, PeftConfig, get_peft_model, LoraConfig
|
14 |
|
15 |
+
# maximum token length for inputs
|
16 |
+
MAX_SOURCE_LENGTH = 512
|
17 |
+
|
18 |
# Load endpoints & creds
|
19 |
CLEARML_API_HOST = os.environ["CLEARML_API_HOST"]
|
20 |
CLEARML_WEB_HOST = os.environ["CLEARML_WEB_HOST"]
|
|
|
70 |
# Download the fine-tuned weights via ClearML using your injected creds
|
71 |
task = Task.get_task(task_id="9cc33fb4d1d54378b691188c5e230253")
|
72 |
finetuned_weights_path = task.artifacts["lora-pytorch-bin"].get_local_copy()
|
73 |
+
print(f"Fine-tuned adapter weights downloaded to directory: {os.path.dirname(finetuned_weights_path)}")
|
|
|
74 |
|
75 |
# Create LoRA configuration matching the fine-tuned checkpoint
|
76 |
lora_cfg = LoraConfig(
|