vitormesaque commited on
Commit
ede4d02
·
verified ·
1 Parent(s): 67e3cdb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +30 -0
README.md CHANGED
@@ -34,12 +34,42 @@ The vitormesaque/irisk dataset was obtained through the knowledge base of the MA
34
 
35
  ## Model Usage
36
 
 
37
  ### How to Get Started with the Model
38
 
39
  Use the code below to get started with the model:
40
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  ### Evaluation
44
 
45
  The model was evaluated using a separate portion of the vitormesaque/irisk dataset.
 
34
 
35
  ## Model Usage
36
 
37
+
38
  ### How to Get Started with the Model
39
 
40
  Use the code below to get started with the model:
41
 
42
+ ```python
43
+
44
+ # Load model directly
45
+ from transformers import AutoTokenizer, AutoModelForCausalLM
46
+
47
+ tokenizer = AutoTokenizer.from_pretrained("vitormesaque/i-llama")
48
+ model = AutoModelForCausalLM.from_pretrained("vitormesaque/i-llama")
49
+
50
+ ```
51
+ ## Usage
52
+
53
+ ```python
54
 
55
 
56
+ FastLanguageModel.for_inference(model) # Enable native 2x faster inference
57
+ inputs = tokenizer(
58
+ [
59
+ irisk_prompt.format(
60
+ "Extract issues from the user review in JSON format. For each issue, provide label, functionality, severity (1-5), likelihood (1-5), category (Bug, User Experience, Performance, Security, Compatibility, Functionality, UI, Connectivity, Localization, Accessibility, Data Handling, Privacy, Notifications, Account Management, Payment, Content Quality, Support, Updates, Syncing, Customization), and the sentence.", # instruction
61
+ "I used to love this app, but now it's become frustrating as hell. We can't see lyrics, we can't CHOOSE WHAT SONG WE WANT TO LISTEN TO, we can't skip a song more than a few times, there are ads after every two songs, and all in all it's a horrible overrated app. If I could give this 0 stars, I would.", # input
62
+ "", # output - leave this blank for generation!
63
+ )
64
+ ], return_tensors = "pt").to("cuda")
65
+
66
+
67
+ from transformers import TextStreamer
68
+ text_streamer = TextStreamer(tokenizer)
69
+ _ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 512)
70
+
71
+
72
+ ```
73
  ### Evaluation
74
 
75
  The model was evaluated using a separate portion of the vitormesaque/irisk dataset.