Instructions to use jxu124/TiO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jxu124/TiO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="jxu124/TiO", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jxu124/TiO", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -56,7 +56,7 @@ with torch.no_grad():
|
|
| 56 |
pt_txt = tokenizer([text], return_tensors="pt").input_ids.cuda()
|
| 57 |
pt_img = image_processor([image], return_tensors="pt").pixel_values.to(torch.float16).cuda()
|
| 58 |
gen = model.generate(pt_txt, patch_images=pt_img, top_p=0.5, do_sample=True, no_repeat_ngram_size=3, max_length=256)
|
| 59 |
-
print(tokenizer.batch_decode(gen, skip_special_tokens=True).replace("not yet.", ""))
|
| 60 |
# e.g. [' is he the one who just threw the ball?'] # Due to the generator, different results may be output
|
| 61 |
```
|
| 62 |
|
|
|
|
| 56 |
pt_txt = tokenizer([text], return_tensors="pt").input_ids.cuda()
|
| 57 |
pt_img = image_processor([image], return_tensors="pt").pixel_values.to(torch.float16).cuda()
|
| 58 |
gen = model.generate(pt_txt, patch_images=pt_img, top_p=0.5, do_sample=True, no_repeat_ngram_size=3, max_length=256)
|
| 59 |
+
print(tokenizer.batch_decode(gen, skip_special_tokens=True)[0].replace("not yet.", ""))
|
| 60 |
# e.g. [' is he the one who just threw the ball?'] # Due to the generator, different results may be output
|
| 61 |
```
|
| 62 |
|