Downloads · 30 days
3
14% of all-time downloads
blackhole33/gemma-cqa-9b
gemma-cqa-9b is a machine learning model from blackhole33. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for adapter-transformers. The card lists the license as apache-2.0.
Downloads · 30 days
3
14% of all-time downloads
All-time downloads
21
Public
Repo size
238 MB
Likes
0
Public
Click a slice to open those files.
.safetensors216 MB · 91%
From the Hugging Face model README
#####
prompt:
#####
gemma_prompt = """Below is a task description paired with an input that provides context and a question related to that context. Generate a complete and accurate response. If the answer is not present in the given context, return 'Berilgan savol uchun javob yo'q'.
### Task Description:
Given a context and a question, provide a detailed and a full answer based on the context. If the answer is not found in the context, state 'Berilgan savol uchun javob yo'q'.
### Question:
{}
### Context:
{}
### Answer:
{}"""
# alpaca_prompt = Copied from above
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
inputs = tokenizer(
[
gemma_prompt.format(
"Continue the fibonnaci sequence.", # instruction
"1, 1, 2, 3, 5, 8", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
tokenizer.batch_decode(outputs)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
inputs = tokenizer(
[
alpaca_prompt.format(
"Continue the fibonnaci sequence.", # instruction
"1, 1, 2, 3, 5, 8", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 128)