Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| OCRonos-Vintage.Q2_K.gguf | Q2_K | 0.08GB |
| OCRonos-Vintage.IQ3_XS.gguf | IQ3_XS | 0.08GB |
| OCRonos-Vintage.IQ3_S.gguf | IQ3_S | 0.08GB |
| OCRonos-Vintage.Q3_K_S.gguf | Q3_K_S | 0.08GB |
| OCRonos-Vintage.IQ3_M.gguf | IQ3_M | 0.09GB |
| OCRonos-Vintage.Q3_K.gguf | Q3_K | 0.09GB |
| OCRonos-Vintage.Q3_K_M.gguf | Q3_K_M | 0.09GB |
| OCRonos-Vintage.Q3_K_L.gguf | Q3_K_L | 0.1GB |
| OCRonos-Vintage.IQ4_XS.gguf | IQ4_XS | 0.1GB |
| OCRonos-Vintage.Q4_0.gguf | Q4_0 | 0.1GB |
| OCRonos-Vintage.IQ4_NL.gguf | IQ4_NL | 0.1GB |
| OCRonos-Vintage.Q4_K_S.gguf | Q4_K_S | 0.1GB |
| OCRonos-Vintage.Q4_K.gguf | Q4_K | 0.11GB |
| OCRonos-Vintage.Q4_K_M.gguf | Q4_K_M | 0.11GB |
| OCRonos-Vintage.Q4_1.gguf | Q4_1 | 0.11GB |
| OCRonos-Vintage.Q5_0.gguf | Q5_0 | 0.11GB |
| OCRonos-Vintage.Q5_K_S.gguf | Q5_K_S | 0.11GB |
| OCRonos-Vintage.Q5_K.gguf | Q5_K | 0.12GB |
| OCRonos-Vintage.Q5_K_M.gguf | Q5_K_M | 0.12GB |
| OCRonos-Vintage.Q5_1.gguf | Q5_1 | 0.12GB |
| OCRonos-Vintage.Q6_K.gguf | Q6_K | 0.13GB |
| OCRonos-Vintage.Q8_0.gguf | Q8_0 | 0.17GB |
1srun --ntasks-per-node=4 --gres=gpu:4 ./train_gpt2cu \
2 -i "dev/data/english_ocr/us_ocr_instruct_*.bin" \
3 -j "dev/data/english_ocr/us_ocr_instruct_*.bin" \
4 -o ocr_model_2 \
5 -e "d12" \
6 -b 128 \
7 -t 1024 \
8 -d 2097152 \
9 -r 1 \
10 -z 1 \
11 -c 0.1 \
12 -l 0.0006 \
13 -q 0.0 \
14 -u 700 \
15 -n 1000 \
16 -v 250 \
17 -s 250 \
18 -h 1 \
19 -x 9060
1import torch
2from transformers import GPT2LMHeadModel, GPT2Tokenizer
3
4# Load pre-trained model and tokenizer
5model_name = "PleIAs/OCRonos-Vintage"
6model = GPT2LMHeadModel.from_pretrained(model_name)
7tokenizer = GPT2Tokenizer.from_pretrained(model_name)
8
9# Set the device to GPU if available, otherwise use CPU
10device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11model.to(device)1# Function to generate text
2def ocr_correction(prompt, max_new_tokens=600):
3
4 prompt = f"""### Text ###\n{prompt}\n\n\n### Correction ###\n"""
5 input_ids = tokenizer.encode(prompt, return_tensors="pt").to(device)
6
7 # Generate text
8 output = model.generate(input_ids,
9 max_new_tokens=max_new_tokens,
10 pad_token_id=tokenizer.eos_token_id,
11 top_k=50)
12
13 # Decode and return the generated text
14 return tokenizer.decode(output[0], skip_special_tokens=True)
15
16ocr_result = ocr_correction(prompt)
17print(ocr_result)Tho l.cgislaluroof New Jersey rc-asscmbled at Trenton, pursuant to an ndjoi.rnmonl, 011 Tuesday. llolh hoiisas' wcro organized for business, of which fact they informed the Gov ernor, when they iccetvcd Iho following sjiccinl message.MKSSAGF. OF T1IH GOVKIiNOH OF Ni:w ji:ksi:y.Tii tho Legislative CnimrilanJ Ucneral AiMinbt o Tlio Stulo of New Jeney. Gentlemen, I herewith transmit a commu nication recently made lo mo from Washing Ion, by fivo of the members of Cougrcks from this State, announcing that they havo beuu excluded from their seats in thn House of Hep rcscntativcri, and in tho most extraordinary manner. I present it to you with feelings of the mosl painful regret thai an event should havo occurred so calculated In disturb tho friendly relations which havo hitherto subsis ted between this Stato nnd tho Federal Legis lature. And in this feeling you will, I am sure, fully participate.
The Legislature of New Jersey assembled at Trenton, pursuant to an adjournment, on Tuesday. Both houses were organized for business, of which fact they informed the Governor, when they received the following special message.MESSAGE OF THE GOVERNOR OF NEW JERSEY.To the Legislative Committee of the State of New Jersey:Gentlemen, I herewith transmit a communication recently made to me from Washington, by five of the members of Congress from this State, announcing that they have been excluded from their seats in the House of Representatives, and in the most extraordinary manner. I present it to you with feelings of the most painful regret that an event should have occurred so calculated to disturb the friendly relations which have hitherto subsisted between this State and the Federal Legislature. And in this feeling, you will, I am sure, fully participate.
1# Function to generate text
2def historical_generation(prompt, max_new_tokens=600):
3
4 prompt = f"""### Text ###\n{prompt}"""
5 input_ids = tokenizer.encode(prompt, return_tensors="pt").to(device)
6
7 # Generate text
8 output = model.generate(input_ids,
9 max_new_tokens=max_new_tokens,
10 pad_token_id=tokenizer.eos_token_id,
11 top_k=50,
12 temperature=0.3,
13 top_p=0.95,
14 do_sample=True,
15 repetition_penalty=1.5)
16
17 # Decode and return the generated text
18 return tokenizer.decode(output[0], skip_special_tokens=True)
19
20historical_generation("Either Donald Trump or Kamala Harris could become the next president of the United States. The Republican candidate, Donald Trump, is)Either Donald Trump or Kamala Harris could become the next president of the United States. The Republican candidate, Donald Trump, is a member of Congress and has been in office for many years past. He was born at New Orleans on May 1st, 1851; came to this country when he went into business as an insurance agent with his father-in law, Mr. John Tompkins, then President of Louisiana State Bank, Mississippi, which position he held until 1870, where he remained till 1907. In 1911 he became secretary of state under Governor Fort during that time. During all these four administrations he served as governor over three times before becoming Secretary of War. His first term expired March 4th last year after having filled out two terms by 'appointment from Washington's cabinet since its organization. This nomination took place April 6th following. On June 7th, 1912, there were only one candidates who had not made good their choice. They are: James H. Davis, ex-Governor, Honorable William J. Bryan, former Congressman from South Carolina, Hon. Wm. A. Jones, Judge Advocate General of Georgia, Drs. E. L. Bowers, Rufus S. Smith, C. F. Dickson, M. P. Williams, Jr., Thomas O'Neal, Henry Ketchum, Robert Gossett, Charles Nott, Frank Brownell, George Vann, Josephine Johnson, Louisa Knight, Arthur Woodall, Albert Anderson, Edward Whitehead, Chas. McPherson, Walter Clark, Harry Wilson, David Miller, and others. '