Downloads · 30 days
469
8% of all-time downloads
RichardErkhov/curiousily_-_tiny-crypto-sentiment-analysis-gguf
curiousily_-_tiny-crypto-sentiment-analysis-gguf is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
469
8% of all-time downloads
All-time downloads
6.1K
Public
Repo size
12.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf14.7 GB · 100%
From the Hugging Face model README
Quantization made by Richard Erkhov.
tiny-crypto-sentiment-analysis - GGUF
license: apache-2.0 library_name: transformers tags:
Fine-tuned (with LoRA) version of TinyLlama on cryptocurrency news articles to predict the sentiment and subject of an article. The dataset used for training is Crypto News+.
Follow the complete tutorial on how this model was trained: https://www.mlexpert.io/bootcamp/fine-tuning-tiny-llm-on-custom-dataset
Load the model:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
MODEL_NAME = "curiousily/tiny-crypto-sentiment-analysis"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
device_map="auto",
torch_dtype=torch.float16
)
pipe = pipeline(
task="text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=16,
return_full_text=False,
)
Prompt format:
prompt = """
### Title:
<YOUR ARTICLE TITLE>
### Text:
<YOUR ARTICLE PARAGRAPH>
### Prediction:
""".strip()
Here's an example:
prompt = """
### Title:
Bitcoin Price Prediction as BTC Breaks Through $27,000 Barrier Here are Price Levels to Watch
### Text:
Bitcoin, the world's largest cryptocurrency by market capitalization, has been making headlines recently as it broke through the $27,000 barrier for the first time. This surge in price has reignited speculation about where Bitcoin is headed next, with many analysts and investors offering their predictions.
### Prediction:
""".strip()
Get a prediction:
outputs = pipe(prompt)
print(outputs[0]["generated_text"].strip())
subject: bitcoin
sentiment: positive