Abhishekcr448/Hinglish-Everyday-Conversations-1M
Viewer • Updated • 1M • 808 • 17
How to use rudrashah/RLM_hingu with KerasHub:
import keras_hub
# Load CausalLM model (optional: use half precision for inference)
causal_lm = keras_hub.models.CausalLM.from_preset("hf://rudrashah/RLM_hingu", dtype="bfloat16")
causal_lm.compile(sampler="greedy") # (optional) specify a sampler
# Generate text
causal_lm.generate("Keras: deep learning for", max_length=64)
import keras_hub
# Create a Backbone model unspecialized for any task
backbone = keras_hub.models.Backbone.from_preset("hf://rudrashah/RLM_hingu")
How to use rudrashah/RLM_hingu with Keras:
# Available backend options are: "jax", "torch", "tensorflow".
import os
os.environ["KERAS_BACKEND"] = "jax"
import keras
model = keras.saving.load_model("hf://rudrashah/RLM_hingu")
RLM_hingu is a fine-tuned version of the Gemma-3B Instruct model, adapted for casual Hinglish (Hindi-English) conversation using the keras-nlp framework. It is designed for lightweight conversational tasks in Hinglish, optimized with the JAX backend for efficiency.
gemma3_instruct_1bkeras-nlpfrom keras_nlp.models import Gemma3CausalLM
from keras_nlp.samplers import TopKSampler
model = Gemma3CausalLM.from_preset("hf://rudrashah/RLM_hingu")
template = "Question:\n{question}\n\nAnswer:\n{answer}"
prompt = template.format(
question="Rudra acha ladka hai?",
answer="",
)
output = model.generate(prompt, max_length=256)
print(output)
Question:
Rudra acha ladka hai?
Answer:
haan, sabse best hai.
To run RLM_hingu, just paste this code and wait.