DevWorld commited on
Commit
83cfecc
1 Parent(s): b20e65d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -1
README.md CHANGED
@@ -1,3 +1,63 @@
1
  ---
2
- license: gemma
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: [apache-2.0, gemma]
3
+ datasets:
4
+ - traintogpb/aihub-koen-translation-integrated-base-10m
5
+ language:
6
+ - ko
7
+ - en
8
+ pipeline_tag: translation
9
+ tags:
10
+ - gemma
11
  ---
12
+ # Gemago Model Card
13
+
14
+ **Original Gemma Model Page**: [Gemma](https://ai.google.dev/gemma/docs)
15
+
16
+ **Model Page On Github**: [Gemago](https://github.com/deveworld/Gemago)
17
+
18
+ **Resources and Technical Documentation**:
19
+ * [Blog(Korean)](https://blog.worldsw.dev/tag/gemago/)
20
+ * [Original Google's Gemma-2B](https://huggingface.co/google/gemma-2b)
21
+ * [Training Code @ Github: Gemma-EasyLM (Orginial by Beomi)](https://github.com/deveworld/Gemma-EasyLM/tree/2b)
22
+
23
+ **Terms of Use**: [Terms](https://www.kaggle.com/models/google/gemma/license/consent)
24
+
25
+ **Authors**: Orginal Google, Fine-tuned by DevWorld
26
+
27
+ ## Model Information
28
+
29
+ Translate English/Korean to Korean/English.
30
+
31
+ ### Description
32
+
33
+ Gemago is a lightweight English-and-Korean translation model based on Gemma.
34
+
35
+ ### Context Length
36
+ Models are trained on a context length of 8192 tokens, which is equivalent to Gemma.
37
+
38
+ ### Usage
39
+
40
+ Below we share some code snippets on how to get quickly started with running the model. First make sure to `pip install -U keras keras-nlp`, then copy the snippet from the section that is relevant for your usecase.
41
+
42
+ #### Running the model with transformers
43
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/deveworld/Gemago/blob/main/Gemago_2b_Infer.ipynb)
44
+
45
+ ```python
46
+ from transformers import AutoTokenizer, AutoModelForCausalLM
47
+
48
+ tokenizer = AutoTokenizer.from_pretrained("devworld/gemago-2b")
49
+ model = AutoModelForCausalLM.from_pretrained("devworld/gemago-2b")
50
+
51
+ def gen(text, max_length):
52
+ input_ids = tokenizer(text, return_tensors="pt")
53
+ outputs = model.generate(**input_ids, max_length=max_length)
54
+ return tokenizer.decode(outputs[0])
55
+
56
+ def e2k(e):
57
+ input_text = f"English:\n{e}\n\nKorean:\n"
58
+ return gen(input_text, 1024)
59
+
60
+ def k2e(k):
61
+ input_text = f"Korean:\n{k}\n\nEnglish:\n"
62
+ return gen(input_text, 1024)
63
+ ```