Downloads · 30 days
9
4% of all-time downloads
MarioBoscoGPU/fqpegaqmsmbd
fqpegaqmsmbd is a text generation model from MarioBoscoGPU. Use it when you need the model to write or continue text. It is set up for transformers.
This repository wraps privateLLMmodel.py as a custom Hugging Face Transformers model. The private script is loaded only at runtime.
Downloads · 30 days
9
4% of all-time downloads
All-time downloads
225
Public
Repo size
1.6 KB
Likes
0
Public
Click a slice to open those files.
.py28.8 KB · 82%
From the Hugging Face model README
This repository wraps private_LLM_model.py as a custom Hugging Face
Transformers model. The private script is loaded only at runtime.
Loading this model requires
trust_remote_code=Truebecause it uses custom model and tokenizer code.
pip install -r requirements.txt
from transformers import pipeline
generator = pipeline(
"text-generation",
model="YOUR_USERNAME/YOUR_REPO",
trust_remote_code=True,
)
print(generator("Write a short greeting.", max_new_tokens=64))
from transformers import AutoModelForCausalLM
from transformers import AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"YOUR_USERNAME/YOUR_REPO",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"YOUR_USERNAME/YOUR_REPO",
trust_remote_code=True,
)
print(model.generate_text("Write a short greeting."))
from transformers import pipeline
pipe = pipeline(
"private-llm",
model=".",
trust_remote_code=True,
)
print(pipe("Write a short greeting."))
Authenticate first:
hf auth login
Then upload the current folder:
python publish_to_hub.py YOUR_USERNAME/YOUR_REPO
The publish script creates a private model repository by default. Use
--public only if you want the Hub repo to publicly expose
private_LLM_model.py.
The wrapper auto-detects these common patterns:
load_model, create_model, build_model, get_model,
load_llmmodel, llm, MODEL, LLM_MODELPrivateLLM, LLM, Modelgenerate_text, generate, complete,
predict, chat, __call__If the script is meant to be run directly instead of imported, set this in
config.json:
{
"execution_mode": "subprocess"
}
Subprocess mode sends the prompt to stdin by default. It also sets
PRIVATE_LLM_PROMPT and PRIVATE_LLM_KWARGS environment variables.
To pin exact names without changing your private script, set fields like:
{
"loader_function": "load_model",
"generate_function": "generate"
}
If your private script returns the full prompt plus completion instead of only the completion text, set:
{
"private_output_includes_prompt": true
}