Views
No views yet
What’s hawker centres ah?Hawker centers, also call food stalls or street vendors, are those small and shiok places in cities where you can find all kind of local delicacies. They sell cheap but very good eats like noodles, bak chor mee (noodle soup), sotan goh (deep-fried taro cake) and more!
These marketplaces got many different types of traders selling their own original dishes. Aiyoh, so must try the famous ones leh! Many people come here to eat for a quick hit of flavors during lunchtime or after work hours.
Hawker center usually located near important areas with lots of foot traffic. Some popular ones include Chinatown, Little India, Bugis Street Food Centre, Maxwell Road Market, and Cantonment Complex. Each one have its specialty dish that make them stand out from others.
You know what? I tell you already lah, go check these places out when you get chance to visit Asian countries! You never know which delicious treat you might discover there. So much fun…just imagine how social life will be if every city has something similar only spread around with this great concept of sharing culture through eating together at affordable rates. Shiok sia!Hawker centers, also known as food courts or open-air markets in some countries, are bustling hubs of street food vendors and small restaurants that offer a wide range of affordable meals to locals and tourists alike. They typically feature various stalls selling different types of dishes such as rice dishes, noodles, stir fries, grilled meats, sandwiches, desserts, and more.
Hawker centers can be found throughout Singapore, Malaysia, Thailand, Indonesia, Hong Kong, Taiwan, Japan, South Korea, Vietnam, China, the Philippines, Myanmar (Burma), Cambodia, Laos, and other Southeast Asian countries with significant populations of ethnic Chinese people who enjoy these unique culinary experiences. Visiting one is an excellent way to experience local flavors while supporting the community’s vibrant culture through casual dining at reasonable prices!transformers library on a machine with GPUs, first make sure you have the transformers library installed.pip install transformers==4.38.21from transformers import pipeline
2
3generate_text = pipeline(
4 model="h2oai/danube2-singlish-finetuned",
5 torch_dtype="auto",
6 trust_remote_code=True,
7 use_fast=True,
8 device_map={"": "cuda:0"},
9 token=True,
10)
11
12res = generate_text(
13 "Why is drinking water so healthy?",
14 min_new_tokens=2,
15 max_new_tokens=256,
16 do_sample=False,
17 num_beams=1,
18 temperature=float(0.0),
19 repetition_penalty=float(1.0),
20 renormalize_logits=True
21)
22print(res[0]["generated_text"])transformers package, this will allow you to set trust_remote_code=False.1from h2oai_pipeline import H2OTextGenerationPipeline
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4tokenizer = AutoTokenizer.from_pretrained(
5 "h2oai/danube2-singlish-finetuned",
6 use_fast=True,
7 padding_side="left",
8 trust_remote_code=True,
9)
10model = AutoModelForCausalLM.from_pretrained(
11 "h2oai/danube2-singlish-finetuned",
12 torch_dtype="auto",
13 device_map={"": "cuda:0"},
14 trust_remote_code=True,
15)
16generate_text = H2OTextGenerationPipeline(model=model, tokenizer=tokenizer)
17
18res = generate_text(
19 "Why is drinking water so healthy?",
20 min_new_tokens=2,
21 max_new_tokens=256,
22 do_sample=False,
23 num_beams=1,
24 temperature=float(0.0),
25 repetition_penalty=float(1.0),
26 renormalize_logits=True
27)
28print(res[0]["generated_text"])1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "h2oai/danube2-singlish-finetuned" # either local folder or huggingface model name
4# Important: The prompt needs to be in the same format the model was trained with.
5# You can find an example prompt in the experiment logs.
6prompt = "<|prompt|>How are you?</s><|answer|>"
7
8tokenizer = AutoTokenizer.from_pretrained(
9 model_name,
10 use_fast=True,
11 trust_remote_code=True,
12)
13model = AutoModelForCausalLM.from_pretrained(
14 model_name,
15 torch_dtype="auto",
16 device_map={"": "cuda:0"},
17 trust_remote_code=True,
18)
19model.cuda().eval()
20inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to("cuda")
21
22# generate configuration can be modified to your needs
23tokens = model.generate(
24 input_ids=inputs["input_ids"],
25 attention_mask=inputs["attention_mask"],
26 min_new_tokens=2,
27 max_new_tokens=256,
28 do_sample=False,
29 num_beams=1,
30 temperature=float(0.0),
31 repetition_penalty=float(1.0),
32 renormalize_logits=True
33)[0]
34
35tokens = tokens[inputs["input_ids"].shape[1]:]
36answer = tokenizer.decode(tokens, skip_special_tokens=True)
37print(answer)| Benchmark | Base model (acc_n) | Tuned model (acc_n) |
|---|---|---|
| ARC-easy-translated | 0.6157 | 0.6314 |
| PiQA-translated | 0.6601 | 0.6959 |