SFT
Collection
Supervised fine-tuning
•
6 items
•
Updated
•
1
StockDirection is a fine-tuned language model for binary stock movement prediction. The model is trained to predict whether the next day’s stock price of Akbank (AKBNK), traded on Borsa Istanbul (BIST), will move UP or DOWN, based on the daily percentage changes from the last four days and the current day.
This model was fine-tuned on a dataset of 6,300 labeled rows of AKBNK stock data.
⚠️ Not for financial advice or live trading decisions.
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-0.6B",)
base_model = AutoModelForCausalLM.from_pretrained(
"unsloth/Qwen3-0.6B",
device_map={"": 0}
)
model = PeftModel.from_pretrained(base_model,"khazarai/StockDirection-6K")
question ="""
You are an assistant that predicts whatever a stock will go up or down in the next day based on the daily percentage price changes of the last:
4 days ago: 0.00
3 days ago: -3.09
2 days ago: 2.13
1 day ago: -2.04
today: 0.01
Predict whatever the next day's price will go up or down. Simply write your prediction as UP or DOWN
"""
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
enable_thinking = False,
)
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 200,
temperature = 0.7,
top_p = 0.8,
top_k = 20,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
For pipeline:
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained("unsloth/Qwen3-0.6B")
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3-0.6B")
model = PeftModel.from_pretrained(base_model, "khazarai/StockDirection-6K")
question ="""
You are an assistant that predicts whatever a stock will go up or down in the next day based on the daily percentage price changes of the last:
4 days ago: 0.00
3 days ago: -3.09
2 days ago: 2.13
1 day ago: -2.04
today: 0.01
Predict whatever the next day's price will go up or down. Simply write your prediction as UP or DOWN
"""
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
messages = [
{"role": "user", "content": question}
]
pipe(messages)
Example:
Question: You are an assistant that predicts whether a stock will go up or down in the next day
based on the daily percentage price changes of the last:
4 days ago: nan
3 days ago: 0.00
2 days ago: 2.22
1 day ago: -2.17
today: -2.22
Predict whether the next day's price will go up or down.
Simply write your prediction as UP or DOWN.
Answer: DOWN