AINovice2005
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -17,7 +17,8 @@ ElEmperador is an ORPO finetinue derived from the Mistral-7B-v0.1 base model.
|
|
17 |
|
18 |
Inference Script:
|
19 |
|
20 |
-
|
|
|
21 |
# Load the tokenizer and model from Hugging Face Hub
|
22 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
23 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
@@ -34,7 +35,7 @@ Inference Script:
|
|
34 |
|
35 |
return generated_text
|
36 |
|
37 |
-
|
38 |
# Set the model name from Hugging Face Hub
|
39 |
model_name = "AINovice2005/ElEmperador"
|
40 |
input_text = "Hello, how are you?"
|
|
|
17 |
|
18 |
Inference Script:
|
19 |
|
20 |
+
```yaml
|
21 |
+
def generate_response(model_name, input_text, max_new_tokens=50):
|
22 |
# Load the tokenizer and model from Hugging Face Hub
|
23 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
24 |
model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
|
35 |
|
36 |
return generated_text
|
37 |
|
38 |
+
if __name__ == "__main__":
|
39 |
# Set the model name from Hugging Face Hub
|
40 |
model_name = "AINovice2005/ElEmperador"
|
41 |
input_text = "Hello, how are you?"
|