ArmelR commited on
Commit
6afdf95
1 Parent(s): ee26113

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -1
README.md CHANGED
@@ -54,12 +54,21 @@ The usage is straightforward and very similar to any other instruction fine-tune
54
 
55
  ```python
56
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
57
  checkpoint_name="ArmelR/starcoder-gradio-v0"
58
  model = AutoModelForCausalLM.from_pretrained(checkpoint_name)
59
  tokenizer = AutoTokenizer.from_pretrained(checkpoint_name)
 
60
  prompt = "Create a gradio application that help to convert temperature in celcius into temperature in Fahrenheit"
61
  inputs = tokenizer(f"Question: {prompt}\n\nAnswer: ", return_tensors="pt")
62
- outputs = model.generate(inputs["input_ids"], temperature=0.2, top_p=0.95, max_length=200)
 
 
 
 
 
 
 
63
  input_len=len(inputs["input_ids"])
64
  print(tokenizer.decode(outputs[0][input_len:]))
65
  ```
 
54
 
55
  ```python
56
  from transformers import AutoModelForCausalLM, AutoTokenizer
57
+
58
  checkpoint_name="ArmelR/starcoder-gradio-v0"
59
  model = AutoModelForCausalLM.from_pretrained(checkpoint_name)
60
  tokenizer = AutoTokenizer.from_pretrained(checkpoint_name)
61
+
62
  prompt = "Create a gradio application that help to convert temperature in celcius into temperature in Fahrenheit"
63
  inputs = tokenizer(f"Question: {prompt}\n\nAnswer: ", return_tensors="pt")
64
+
65
+ outputs = model.generate(
66
+ inputs["input_ids"],
67
+ temperature=0.2,
68
+ top_p=0.95,
69
+ max_new_tokens=200
70
+ )
71
+
72
  input_len=len(inputs["input_ids"])
73
  print(tokenizer.decode(outputs[0][input_len:]))
74
  ```