Instructions to use aksw/Bike-name with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aksw/Bike-name with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aksw/Bike-name", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use aksw/Bike-name with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aksw/Bike-name to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for aksw/Bike-name to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for aksw/Bike-name to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="aksw/Bike-name", max_seq_length=2048, )
Update README.md
Browse files
README.md
CHANGED
|
@@ -77,7 +77,7 @@ pip install unsloth torch
|
|
| 77 |
from unsloth import FastLanguageModel
|
| 78 |
import torch
|
| 79 |
|
| 80 |
-
class
|
| 81 |
def __init__(self, model_name: str, max_seq_length: int = 32768, load_in_4bit: bool = True):
|
| 82 |
self.model, self.tokenizer = FastLanguageModel.from_pretrained(
|
| 83 |
model_name=model_name,
|
|
@@ -97,7 +97,7 @@ class SPARQLQueryGenerator:
|
|
| 97 |
{"role": "user", "content": article_text}
|
| 98 |
]
|
| 99 |
|
| 100 |
-
def
|
| 101 |
si = "<|im_start|>assistant<|im_sep|>"
|
| 102 |
sf = "<|im_end|>"
|
| 103 |
messages = self.build_prompt(article_text)
|
|
@@ -117,9 +117,9 @@ class SPARQLQueryGenerator:
|
|
| 117 |
|
| 118 |
# --- Using the model ---
|
| 119 |
if __name__ == "__main__":
|
| 120 |
-
|
| 121 |
text = "Title, Abstract, Introduction, Background, Method, Results, Conclusion, References."
|
| 122 |
-
list_names =
|
| 123 |
print(list_names)
|
| 124 |
```
|
| 125 |
|
|
|
|
| 77 |
from unsloth import FastLanguageModel
|
| 78 |
import torch
|
| 79 |
|
| 80 |
+
class BiKECompoundNameExtractor:
|
| 81 |
def __init__(self, model_name: str, max_seq_length: int = 32768, load_in_4bit: bool = True):
|
| 82 |
self.model, self.tokenizer = FastLanguageModel.from_pretrained(
|
| 83 |
model_name=model_name,
|
|
|
|
| 97 |
{"role": "user", "content": article_text}
|
| 98 |
]
|
| 99 |
|
| 100 |
+
def extract_compound_name(self, article_text: str, temperature: float = 0.01, max_new_tokens: int = 1024) -> str:
|
| 101 |
si = "<|im_start|>assistant<|im_sep|>"
|
| 102 |
sf = "<|im_end|>"
|
| 103 |
messages = self.build_prompt(article_text)
|
|
|
|
| 117 |
|
| 118 |
# --- Using the model ---
|
| 119 |
if __name__ == "__main__":
|
| 120 |
+
extractor = BiKECompoundNameExtractor(model_name="aksw/Bike-name")
|
| 121 |
text = "Title, Abstract, Introduction, Background, Method, Results, Conclusion, References."
|
| 122 |
+
list_names = extractor.extract_compound_name(text)
|
| 123 |
print(list_names)
|
| 124 |
```
|
| 125 |
|