Upload examples/basic_usage.py with huggingface_hub
Browse files- examples/basic_usage.py +6 -6
examples/basic_usage.py
CHANGED
|
@@ -15,7 +15,7 @@ def example_1_default_model():
|
|
| 15 |
print("=" * 60)
|
| 16 |
|
| 17 |
model = AutoModel.from_pretrained(
|
| 18 |
-
"
|
| 19 |
trust_remote_code=True
|
| 20 |
)
|
| 21 |
|
|
@@ -31,7 +31,7 @@ def example_2_variant_by_parameters():
|
|
| 31 |
print("=" * 60)
|
| 32 |
|
| 33 |
model = AutoModel.from_pretrained(
|
| 34 |
-
"
|
| 35 |
data_source="7T-21T",
|
| 36 |
k_neighbors=1,
|
| 37 |
metric="euclidean",
|
|
@@ -54,7 +54,7 @@ def example_3_variant_by_name():
|
|
| 54 |
print("=" * 60)
|
| 55 |
|
| 56 |
model = AutoModel.from_pretrained(
|
| 57 |
-
"
|
| 58 |
variant="knn_21T_k3_manhattan",
|
| 59 |
trust_remote_code=True
|
| 60 |
)
|
|
@@ -72,7 +72,7 @@ def example_4_make_predictions():
|
|
| 72 |
|
| 73 |
# Load model
|
| 74 |
model = AutoModel.from_pretrained(
|
| 75 |
-
"
|
| 76 |
trust_remote_code=True
|
| 77 |
)
|
| 78 |
|
|
@@ -117,7 +117,7 @@ def example_5_compare_models():
|
|
| 117 |
|
| 118 |
for name, params in variants:
|
| 119 |
model = AutoModel.from_pretrained(
|
| 120 |
-
"
|
| 121 |
trust_remote_code=True,
|
| 122 |
**params
|
| 123 |
)
|
|
@@ -146,5 +146,5 @@ if __name__ == "__main__":
|
|
| 146 |
except Exception as e:
|
| 147 |
print(f"\n[ERROR] Error: {e}")
|
| 148 |
print("\nNote: These examples require the model to be uploaded to")
|
| 149 |
-
print(" Hugging Face Hub at:
|
| 150 |
print("\nFor local testing, replace the repo ID with a local path.")
|
|
|
|
| 15 |
print("=" * 60)
|
| 16 |
|
| 17 |
model = AutoModel.from_pretrained(
|
| 18 |
+
"SaeedLab/dom-formula-assignment-using-knn",
|
| 19 |
trust_remote_code=True
|
| 20 |
)
|
| 21 |
|
|
|
|
| 31 |
print("=" * 60)
|
| 32 |
|
| 33 |
model = AutoModel.from_pretrained(
|
| 34 |
+
"SaeedLab/dom-formula-assignment-using-knn",
|
| 35 |
data_source="7T-21T",
|
| 36 |
k_neighbors=1,
|
| 37 |
metric="euclidean",
|
|
|
|
| 54 |
print("=" * 60)
|
| 55 |
|
| 56 |
model = AutoModel.from_pretrained(
|
| 57 |
+
"SaeedLab/dom-formula-assignment-using-knn",
|
| 58 |
variant="knn_21T_k3_manhattan",
|
| 59 |
trust_remote_code=True
|
| 60 |
)
|
|
|
|
| 72 |
|
| 73 |
# Load model
|
| 74 |
model = AutoModel.from_pretrained(
|
| 75 |
+
"SaeedLab/dom-formula-assignment-using-knn",
|
| 76 |
trust_remote_code=True
|
| 77 |
)
|
| 78 |
|
|
|
|
| 117 |
|
| 118 |
for name, params in variants:
|
| 119 |
model = AutoModel.from_pretrained(
|
| 120 |
+
"SaeedLab/dom-formula-assignment-using-knn",
|
| 121 |
trust_remote_code=True,
|
| 122 |
**params
|
| 123 |
)
|
|
|
|
| 146 |
except Exception as e:
|
| 147 |
print(f"\n[ERROR] Error: {e}")
|
| 148 |
print("\nNote: These examples require the model to be uploaded to")
|
| 149 |
+
print(" Hugging Face Hub at: SaeedLab/dom-formula-assignment-using-knn")
|
| 150 |
print("\nFor local testing, replace the repo ID with a local path.")
|