Vishal24 / BCG_adapter_v1

huggingface.co
Total runs: 7
24-hour runs: 0
7-day runs: 1
30-day runs: 5
Model's Last Updated: 2024年1月24日

Introduction of BCG_adapter_v1

Model Details of BCG_adapter_v1

Model Card for Model ID

Model Details
Model Description
  • Developed by: [More Information Needed]
  • Funded by [optional]: [More Information Needed]
  • Shared by [optional]: [More Information Needed]
  • Model type: [More Information Needed]
  • Language(s) (NLP): [More Information Needed]
  • License: [More Information Needed]
  • Finetuned from model [optional]: [More Information Needed]
Infrence Function
for branded or generic
def generate1(keyword):

  prompt = f"""[INST] Annotate the keyword into branded or generic.[/INST]

      [KW] {keyword} [/KW]
      
      response ###"""
  print("Prompt:")
  print(prompt)
  encoding = tokenizer(prompt, return_tensors="pt").to("cuda:0")
  output = model.generate(input_ids=encoding.input_ids,
                          attention_mask=encoding.attention_mask,
                          max_new_tokens=200,
                          do_sample=True,
                          temperature=0.9,
                          eos_token_id=tokenizer.eos_token_id,
                          top_p=0.9,
                         repetition_penalty=1.2)

  print()
  # Subtract the length of input_ids from output to get only the model's response
  output_text = tokenizer.decode(output[0, len(encoding.input_ids[0]):], skip_special_tokens=False)
  output_text = re.sub('\n+', '\n', output_text)  # remove excessive newline characters
  print("Generated Assistant Response:")
  print(output_text)

  
  return output_text
for brand name
def generate2(lista,keyword):
  
  prompt = f"""[INST] Extract the brand of the keyword from the given list if present.[/INST]

      [KW] {keyword} [/KW]

      [LIST] {lista} [/LIST]

      
      response ###"""
  print("Prompt:")
  print(prompt)
  encoding = tokenizer(prompt, return_tensors="pt").to("cuda:0")
  output = model.generate(input_ids=encoding.input_ids,
                          attention_mask=encoding.attention_mask,
                          max_new_tokens=200,
                          do_sample=True,
                          temperature=0.9,
                          eos_token_id=tokenizer.eos_token_id,
                          top_p=0.9,
                         repetition_penalty=1.2)

  print()
  # Subtract the length of input_ids from output to get only the model's response
  output_text = tokenizer.decode(output[0, len(encoding.input_ids[0]):], skip_special_tokens=False)
  output_text = re.sub('\n+', '\n', output_text)  # remove excessive newline characters
  print("Generated Assistant Response:")
  return output_text   

Runs of Vishal24 BCG_adapter_v1 on huggingface.co

7
Total runs
0
24-hour runs
0
3-day runs
1
7-day runs
5
30-day runs

More Information About BCG_adapter_v1 huggingface.co Model

BCG_adapter_v1 huggingface.co

BCG_adapter_v1 huggingface.co is an AI model on huggingface.co that provides BCG_adapter_v1's model effect (), which can be used instantly with this Vishal24 BCG_adapter_v1 model. huggingface.co supports a free trial of the BCG_adapter_v1 model, and also provides paid use of the BCG_adapter_v1. Support call BCG_adapter_v1 model through api, including Node.js, Python, http.

BCG_adapter_v1 huggingface.co Url

https://huggingface.co/Vishal24/BCG_adapter_v1

Vishal24 BCG_adapter_v1 online free

BCG_adapter_v1 huggingface.co is an online trial and call api platform, which integrates BCG_adapter_v1's modeling effects, including api services, and provides a free online trial of BCG_adapter_v1, you can try BCG_adapter_v1 online for free by clicking the link below.

Vishal24 BCG_adapter_v1 online free url in huggingface.co:

https://huggingface.co/Vishal24/BCG_adapter_v1

BCG_adapter_v1 install

BCG_adapter_v1 is an open source model from GitHub that offers a free installation service, and any user can find BCG_adapter_v1 on GitHub to install. At the same time, huggingface.co provides the effect of BCG_adapter_v1 install, users can directly use BCG_adapter_v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

BCG_adapter_v1 install url in huggingface.co:

https://huggingface.co/Vishal24/BCG_adapter_v1

Url of BCG_adapter_v1

BCG_adapter_v1 huggingface.co Url

Provider of BCG_adapter_v1 huggingface.co

Vishal24
ORGANIZATIONS

Other API from Vishal24

huggingface.co

Total runs: 6
Run Growth: 3
Growth Rate: 50.00%
Updated:2023年10月6日
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:2024年5月15日