Transformers
English
Not-For-All-Audiences
Inference Endpoints
thanosswrld commited on
Commit
3dfd8f7
1 Parent(s): 063c736

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +16 -1
README.md CHANGED
@@ -71,6 +71,19 @@ anotherawesomeday = "facebook/wav2vec2-base"
71
  processor = Wav2Vec2Processor.from_pretrained(anotherawesomeday)
72
  model = AutoModelForSeq2SeqLM.from_pretrained(anotherawesomeday)
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  # Load a dataset (example with PolyAI/minds14)
75
  dataset = load_dataset("PolyAI/minds14", "en-US", split="train")
76
 
@@ -112,4 +125,6 @@ def evaluate_text_generation(model, dataset):
112
  def evaluate_audio_generation(model, dataset):
113
  # Calculate CER using jiwer or other audio evaluation tools
114
  # ...
115
- return cer_score
 
 
 
71
  processor = Wav2Vec2Processor.from_pretrained(anotherawesomeday)
72
  model = AutoModelForSeq2SeqLM.from_pretrained(anotherawesomeday)
73
 
74
+ # Load model and tokenizer
75
+ model_name = "anotherawesomeday"
76
+ model = AutoModelForSeq2SeqLM.from_pretrained(anotherawesomeday)
77
+ tokenizer = AutoTokenizer.from_pretrained(anotherawesomeday)
78
+
79
+ # Example: Generate text from input
80
+ input_text = "Hello, how are you?"
81
+ input_ids = tokenizer(input_text, return_tensors="pt").input_ids
82
+ output_ids = model.generate(input_ids)
83
+ generated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
84
+
85
+ print(generated_text)
86
+
87
  # Load a dataset (example with PolyAI/minds14)
88
  dataset = load_dataset("PolyAI/minds14", "en-US", split="train")
89
 
 
125
  def evaluate_audio_generation(model, dataset):
126
  # Calculate CER using jiwer or other audio evaluation tools
127
  # ...
128
+ return cer_score
129
+
130
+ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer