Downloads · 30 days
11
19% of all-time downloads
hsilvosa/hsc-wuxia-glm-4-32b
hsc-wuxia-glm-4-32b is a text generation model from hsilvosa. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as mit.
This model is a fine-tuned LoRA adapter based on GLM-4-32B-0414 for Chinese-to-English translation of Wuxia and Xianxia literature. It was developed as part of the Bachelor's Thesis (TFG): "Enfoques de traducción auto…
Downloads · 30 days
11
19% of all-time downloads
All-time downloads
59
Public
Repo size
260 MB
Likes
0
Public
Click a slice to open those files.
.safetensors260 MB · 100%
From the Hugging Face model README
This model is a fine-tuned LoRA adapter based on GLM-4-32B-0414 for Chinese-to-English translation of Wuxia and Xianxia literature. It was developed as part of the Bachelor's Thesis (TFG):
"Enfoques de traducción automática con modelos de lenguaje en obras wuxia" (Degree in Data Science and Engineering, Universidade da Coruña)
This adapter is intended to be used on top of GLM-4-32B-0414 to translate domain-specific Chinese literary texts into English.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_name = "zai-org/GLM-4-32B-0414"
adapter_model_name = "HSilvosa/hsc-wuxia-glm-4-32b"
# Load base model & tokenizer
tokenizer = AutoTokenizer.from_pretrained(base_model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, adapter_model_name)
# Translate example
text_zh = "一念成沧海,一念化桑田。"
prompt = f"Translate the following Chinese text to English: {text_zh}\nTranslation:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=128)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
The model was evaluated on the Wuxia parallel test set (translating Chinese to English) comparing the base GLM-4-32B-0414 model and this fine-tuned version under Prompt 0, 0-Shot configuration:
| Metric | Base Model (GLM-4-32B-0414) | Fine-tuned Adapter (hsc-wuxia-glm-4-32b) | Delta (Improvement) |
|---|---|---|---|
| SacreBLEU | 9.57 | 13.52 | +3.95 |
| chrF2 | 36.27 | 39.94 | +3.67 |
| TER (lower is better) | 89.49 | 98.79 | -9.30 |
| ROUGE-L (F1) | 39.47 | 41.15 | +1.68 |
| METEOR | 38.97 | 45.27 | +6.30 |
| BERTScore | 77.82 | 78.13 | +0.31 |
| COMET | 72.49 | 72.38 | -0.11 |
The model was fine-tuned using Parameter-Efficient Fine-Tuning (PEFT) via QLoRA with the following configurations:
This model and the associated training/evaluation pipelines were developed in the following project repository:
This research project was made possible through the access granted by the Galician Supercomputing Center (CESGA) to its supercomputing infrastructure. The supercomputer FinisTerrae III and its permanent data storage system have been funded by the NextGeneration EU 2021 Recovery, Transformation and Resilience Plan, ICT2021-006904, and also from the Pluriregional Operational Programme of Spain 2014-2020 of the European Regional Development Fund (ERDF), ICTS-2019-02-CESGA-3, and from the State Programme for the Promotion of Scientific and Technical Research of Excellence of the State Plan for Scientific and Technical Research and Innovation 2013-2016 State subprogramme for scientific and technical infrastructures and equipment of ERDF, CESG15-DE-3114.