munish0838 commited on
Commit
ecc5478
·
verified ·
1 Parent(s): 7a95aeb

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ tags:
5
+ - code
6
+ base_model:
7
+ - 01-ai/Yi-Coder-9B
8
+ library_name: transformers
9
+ pipeline_tag: text-generation
10
+ license: apache-2.0
11
+
12
+ ---
13
+
14
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
15
+
16
+
17
+ # QuantFactory/Typst-Coder-9B-GGUF
18
+ This is quantized version of [TechxGenus/Typst-Coder-9B](https://huggingface.co/TechxGenus/Typst-Coder-9B) created using llama.cpp
19
+
20
+ # Original Model Card
21
+
22
+
23
+ # Typst-Coder
24
+
25
+ <p align="center">
26
+ <a href="https://huggingface.co/TechxGenus/Typst-Coder-1.5B">[🤖Models]</a> |
27
+ <a href="https://github.com/TechxGenus/Typst-Coder">[🛠️Code]</a> |
28
+ <a href="https://huggingface.co/datasets/TechxGenus/Typst-Train">[📊Data]</a> |
29
+ </p>
30
+
31
+ <hr>
32
+
33
+ - [Typst-Coder](#typst-coder)
34
+ - [Introduction](#introduction)
35
+ - [Usage](#usage)
36
+
37
+ <hr>
38
+
39
+ ## Introduction
40
+
41
+ While working with Typst documents, we noticed that AI programming assistants often generate poor results. I understand that these assistants may perform better in languages like Python and JavaScript, which benefit from more extensive datasets and feedback signals from executable code, unlike HTML or Markdown. However, current LLMs even frequently struggle to produce accurate Typst syntax, including models like GPT-4o and Claude-3.5-Sonnet.
42
+
43
+ Upon further investigation, we found that because Typst is a relatively new language, training data for it is scarce. GitHub's search tool doesn't categorize it as a language for code yet, and The Stack v1/v2 don’t include Typst. No open code LLMs currently list it as a supported language, either. To address this, we developed this project aimed at collecting relevant data and training models to improve Typst support in AI programming tools.
44
+
45
+ ## Usage
46
+
47
+ An example script is shown below:
48
+
49
+ ```python
50
+ import torch
51
+ from transformers import AutoTokenizer, AutoModelForCausalLM
52
+
53
+ tokenizer = AutoTokenizer.from_pretrained("TechxGenus/Typst-Coder-9B")
54
+ model = AutoModelForCausalLM.from_pretrained(
55
+ "TechxGenus/Typst-Coder-9B",
56
+ torch_dtype=torch.bfloat16,
57
+ device_map="auto"
58
+ )
59
+
60
+ messages = [
61
+ {"role": "user", "content": "Hi!"},
62
+ ]
63
+ prompt = tokenizer.apply_chat_template(
64
+ messages,
65
+ tokenize=False,
66
+ add_generation_prompt=True
67
+ )
68
+
69
+ inputs = tokenizer.encode(prompt, return_tensors="pt")
70
+ outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=512)
71
+ print(tokenizer.decode(outputs[0]))
72
+ ```
73
+