cjvt
/

dvres commited on
Commit
45c3b0b
1 Parent(s): f0c8c5b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -17
README.md CHANGED
@@ -37,24 +37,33 @@ The inference can be done using the following snippet of code:
37
  ```python
38
  import transformers
39
 
40
- model_id = ("cjvt/GaMS-1B-Chat")
41
- pipeline = transformers.pipeline(
42
- "text-generation",
43
- model=model_id,
44
- device_map="auto"
45
- )
46
-
47
- # Example of response generation
48
- message = [{"role": "user", "content": "Kateri je najpomembnejši dogodek v slovenski zgodovini?"}]
49
- response = pipeline(message, max_length=100)
50
- print("Model's response:", response[0]["generated_text"][-1]["content"])
51
-
52
- # Example of conversation chain
53
- new_message = response[0]["generated_text"]
54
- new_message.append({"role": "user", "content": "Lahko bolj podrobno opišeš ta dogodek?"})
55
- response = pipeline(new_message, max_length=500)
56
- print("Model's response:", response[0]["generated_text"][-1]["content"])
 
 
 
 
 
 
 
 
57
  ```
 
58
  ## Training details
59
 
60
  ### Training data
 
37
  ```python
38
  import transformers
39
 
40
+ model_id = ("cjvt/GaMS-1B")
41
+
42
+ pline = pipeline(
43
+ "text-generation",
44
+ model=model_id,
45
+ device_map="auto"
46
+ )
47
+
48
+ prompts = [
49
+ "The examples of antonyms are:\nhigh => low\nwide => narrow\nbig =>",
50
+ "Pristanek je bil prvi nadzorovani spust ameriškega vesoljskega plovila na površje Lune po Apollu 17 leta 1972, ko je na Luni pristala zadnja Nasina misija s posadko.\nDoslej so na Luni pristala vesoljska plovila le iz štirih drugih držav –",
51
+ "U četvrtak je bila prva polufinalna večer Dore, a komentari na društvenim mrežama ne prestaju. U nedjeljno finale prošli su:"
52
+ ]
53
+
54
+ sequences = pline(
55
+ prompts,
56
+ max_length=1000,
57
+ do_sample=False,
58
+ num_return_sequences=1
59
+ )
60
+
61
+ for seq in sequences:
62
+ print("--------------------------")
63
+ print(f"Result: {seq[0]['generated_text']}")
64
+ print("--------------------------\n")
65
  ```
66
+
67
  ## Training details
68
 
69
  ### Training data