Views
No views yet
Запрос: Write a Lua event system with on, off, and emit methods.
Ответ:
local Event = {listeners = {}}
function Event:on(name, fn)
self.listeners[name] = self.listeners[name] or {}
table.insert(self.listeners[name], fn)
end
function Event:emit(name, ...)
for _, fn in ipairs(self.listeners[name] or {}) do fn(...) end
end
return EventЗапрос: Review this Lua code (SQL query with string concatenation)
Ответ: SQL Injection — используйте параметризованные запросы. Stale cache — очищайте кэш при ошибке.Запрос: I need a Lua save system for my game.
Ответ: Before I write the code, I have a couple questions:
1. Are you saving data to a file or a database?
2. Do you need to handle encryption for sensitive information?| Параметр | Значение |
|---|---|
| Базовая модель | Qwen 2.5 Coder 3B Instruct |
| Метод | QLoRA (4-bit) |
| LoRA rank | 128 |
| LoRA alpha | 256 |
| Learning rate | 8e-5 |
| Эпох | 3 |
| Оптимизатор | AdamW 8-bit |
| Квантизация GGUF | Q8_0 |
ollama run hf.co/kertpoli/lua-coder-qwen25-3b-gguf./llama-server -m lua-coder-q8_0.gguf -ngl 99 -c 1024 --port 80911from llama_cpp import Llama
2
3llm = Llama(model_path="lua-coder-q8_0.gguf", n_gpu_layers=-1, n_ctx=1024)
4
5result = llm.create_chat_completion(
6 messages=[{"role": "user", "content": "Write a Lua stack with push and pop"}],
7 max_tokens=200,
8 temperature=0.3,
9)
10print(result["choices"][0]["message"]["content"])| Формат | Размер | VRAM (GPU) | RAM (CPU) |
|---|---|---|---|
| Q8_0 | 3.1 ГБ | 4 ГБ | 4 ГБ |