Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,21 +49,22 @@ for filename in filenames:
|
|
| 49 |
local_dir="./model/"
|
| 50 |
)
|
| 51 |
|
|
|
|
|
|
|
|
|
|
| 52 |
# def no_logger():
|
| 53 |
# logging.config.dictConfig({
|
| 54 |
# 'version': 1,
|
| 55 |
# 'disable_existing_loggers': True,
|
| 56 |
# })
|
| 57 |
|
| 58 |
-
MODEL_PATH = os.path.abspath("model")
|
| 59 |
-
print(MODEL_PATH)
|
| 60 |
|
| 61 |
model = AutoModelForCausalLM.from_pretrained(
|
| 62 |
-
|
| 63 |
torch_dtype=torch.float16,
|
| 64 |
low_cpu_mem_usage=True,
|
| 65 |
).to(0)
|
| 66 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 67 |
vision_tower = model.get_vision_tower()
|
| 68 |
vision_tower.load_model()
|
| 69 |
vision_tower.to(device="cuda", dtype=torch.float16)
|
|
|
|
| 49 |
local_dir="./model/"
|
| 50 |
)
|
| 51 |
|
| 52 |
+
for items in os.listdir("./model"):
|
| 53 |
+
print(items)
|
| 54 |
+
|
| 55 |
# def no_logger():
|
| 56 |
# logging.config.dictConfig({
|
| 57 |
# 'version': 1,
|
| 58 |
# 'disable_existing_loggers': True,
|
| 59 |
# })
|
| 60 |
|
|
|
|
|
|
|
| 61 |
|
| 62 |
model = AutoModelForCausalLM.from_pretrained(
|
| 63 |
+
pretrained_model_name_or_path="./model/",
|
| 64 |
torch_dtype=torch.float16,
|
| 65 |
low_cpu_mem_usage=True,
|
| 66 |
).to(0)
|
| 67 |
+
tokenizer = AutoTokenizer.from_pretrained(pretrained_model_name_or_path="./model/")
|
| 68 |
vision_tower = model.get_vision_tower()
|
| 69 |
vision_tower.load_model()
|
| 70 |
vision_tower.to(device="cuda", dtype=torch.float16)
|