xzuyn commited on
Commit
fcd2041
·
verified ·
1 Parent(s): d22f2ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -42,6 +42,9 @@ def tokenize(input_text):
42
  codeqwen_tokens = len(
43
  codeqwen_tokenizer(input_text, add_special_tokens=True)["input_ids"]
44
  )
 
 
 
45
 
46
  results = {
47
  "LLaMa-1/LLaMa-2": llama_tokens,
@@ -57,6 +60,7 @@ def tokenize(input_text):
57
  "Command-R": command_r_tokens,
58
  "Qwen/Qwen1.5": qwen_tokens,
59
  "CodeQwen": codeqwen_tokens,
 
60
  }
61
 
62
  # Sort the results in descending order based on token length
@@ -105,8 +109,11 @@ if __name__ == "__main__":
105
  codeqwen_tokenizer = AutoTokenizer.from_pretrained(
106
  "Qwen/CodeQwen1.5-7B"
107
  )
 
 
 
108
 
109
  iface = gr.Interface(
110
- fn=tokenize, inputs=gr.Textbox(label="Input Text", lines=13), outputs="text"
111
  )
112
  iface.launch()
 
42
  codeqwen_tokens = len(
43
  codeqwen_tokenizer(input_text, add_special_tokens=True)["input_ids"]
44
  )
45
+ rwkv_tokens = len(
46
+ rwkv_tokenizer(input_text, add_special_tokens=True)["input_ids"]
47
+ )
48
 
49
  results = {
50
  "LLaMa-1/LLaMa-2": llama_tokens,
 
60
  "Command-R": command_r_tokens,
61
  "Qwen/Qwen1.5": qwen_tokens,
62
  "CodeQwen": codeqwen_tokens,
63
+ "RWKV": rwkv_tokens
64
  }
65
 
66
  # Sort the results in descending order based on token length
 
109
  codeqwen_tokenizer = AutoTokenizer.from_pretrained(
110
  "Qwen/CodeQwen1.5-7B"
111
  )
112
+ rwkv_tokenizer = AutoTokenizer.from_pretrained(
113
+ "RWKV/v5-EagleX-v2-7B-HF"
114
+ )
115
 
116
  iface = gr.Interface(
117
+ fn=tokenize, inputs=gr.Textbox(label="Input Text", lines=14), outputs="text"
118
  )
119
  iface.launch()