SZTAKI-HLT/HunSum-1
Viewer • Updated • 1.15M • 142 • 7
How to use Bazsalanszky/Mistral-7b-0.1-hu with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Bazsalanszky/Mistral-7b-0.1-hu", dtype="auto")How to use Bazsalanszky/Mistral-7b-0.1-hu with Unsloth Studio:
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 Bazsalanszky/Mistral-7b-0.1-hu to start chatting
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 Bazsalanszky/Mistral-7b-0.1-hu to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Bazsalanszky/Mistral-7b-0.1-hu to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="Bazsalanszky/Mistral-7b-0.1-hu",
max_seq_length=2048,
)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 Bazsalanszky/Mistral-7b-0.1-hu to start chatting# No setup required# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for Bazsalanszky/Mistral-7b-0.1-hu to start chattingpip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="Bazsalanszky/Mistral-7b-0.1-hu",
max_seq_length=2048,
)Ez a mistral 7b model magyar szövegre lett tanítva 10 000 véletlenszerűen kiválasztott cikken. Így valamivel szebben ír magyarul, mint az alap model.
Ez a modell NEM lett instrukciókra tanítva, valószínűleg nem fogja azokat követni.
# Load model directly
from transformers import AutoTokenizer, AutoModel
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
adapter_name = model.load_adapter("Bazsalanszky/Mistral-7b-0.1-hu")
model.active_adapters = adapter_name
inputs = tokenizer("Magyarország\nFővárosa:", return_tensors = "pt").to("cpu")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 250)
Itt van egy példa arra, hogy hogyan viselkedik a modell a tanítás előtt és a tanítás után.
Bemenet: Magyarország\nFővárosa:
Magyarország
Fővárosa: Budapest
Népesség: 10 000 000 fő
Terület: 93 030 km²
## Magyarország
Hungary is a landlocked country in Central Europe. It is situated in the Carpathian Basin and is bordered by Slovakia to the north, Ukraine to the northeast, Romania to the east and southeast, Serbia to the south, Croatia to the southwest, Slovenia to the west, and Austria to the northwest. The country's capital and largest city is Budapest. Hungary is a member of the European Union, NATO, the OECD, the Visegr
Magyarország
Fővárosa: 1,7 millió lakosú Budapest
Népesség: 10 millió
Nyelv: magyar
A magyarok a honfoglalás után a mai Magyarország területén telepedtek le. A 11. században a Kárpát-medencében létrejött a Magyar Királyság, amely a 16. században a Habsburg Birodalom része lett. A 19. században a magyarok a szabadságharcot követően a Habsburg Birodalom része lett, majd 1918-ban függetlenné vált. A második világháború után a Szovjetunió szövetségese lett, majd 1989-ben a kommun
Base model
unsloth/mistral-7b-bnb-4bit
Install Unsloth Studio (macOS, Linux, WSL)
# Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Bazsalanszky/Mistral-7b-0.1-hu to start chatting