Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
model_id = "nllg/TikZilla-8B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
eos_token_id = tokenizer.convert_tokens_to_ids("<|im_end|>")
pad_token_id = tokenizer.pad_token_id or tokenizer.eos_token_id or eos_token_id
gen_config = GenerationConfig(
do_sample=True,
temperature=1.0,
top_p=0.9,
max_new_tokens=2048,
eos_token_id=eos_token_id,
pad_token_id=pad_token_id,
)
your_input_description = "A scientific line plot showing two curves. The x-axis is labeled 'Time' ranging from 0 to 100, and the y-axis is labeled 'Value' ranging from 0 to 1. The first curve is a blue solid line that gradually increases from near 0 and levels off around 0.9. The second curve is a red dashed line that rises to a peak around the middle of the plot and then decreases. A legend in the upper right labels the blue line as 'Model A' and the red dashed line as 'Model B'. The background is white with light gray grid lines."
messages = [
{
"role": "user",
"content": (
"Generate a complete LaTeX document that contains a TikZ figure according to the following requirements:\n"
+ your_input_description +
"\nWrap your code using \\documentclass[tikz]{standalone}, and include \\begin{document}...\\end{document}. ""Only output valid LaTeX code with no extra text."
),
}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
output_ids = model.generate(**inputs, generation_config=gen_config)
response_ids = output_ids[0][len(inputs["input_ids"][0]):]
output = tokenizer.decode(response_ids, skip_special_tokens=True)
print(output)
Runs of nllg TikZilla-8B on huggingface.co
11
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About TikZilla-8B huggingface.co Model
TikZilla-8B huggingface.co is an AI model on huggingface.co that provides TikZilla-8B's model effect (), which can be used instantly with this nllg TikZilla-8B model. huggingface.co supports a free trial of the TikZilla-8B model, and also provides paid use of the TikZilla-8B. Support call TikZilla-8B model through api, including Node.js, Python, http.
TikZilla-8B huggingface.co is an online trial and call api platform, which integrates TikZilla-8B's modeling effects, including api services, and provides a free online trial of TikZilla-8B, you can try TikZilla-8B online for free by clicking the link below.
nllg TikZilla-8B online free url in huggingface.co:
TikZilla-8B is an open source model from GitHub that offers a free installation service, and any user can find TikZilla-8B on GitHub to install. At the same time, huggingface.co provides the effect of TikZilla-8B install, users can directly use TikZilla-8B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.