Spaces:
Running
Running
Update convert.py
Browse files- convert.py +1 -1
convert.py
CHANGED
|
@@ -42,7 +42,7 @@ def convert_pdf_to_pgn(file, start_page_no, end_page_no):
|
|
| 42 |
# pgn_text = model.generate_content(create_main_game_prompt(md_text))
|
| 43 |
|
| 44 |
model = genai.GenerativeModel(
|
| 45 |
-
model_name="gemini-
|
| 46 |
generation_config=generation_config,
|
| 47 |
system_instruction="You are a helpful assistant that helps convert a documented chess game from a book into a .pgn file. The text of the game is extracted from a chess book and is in markdown format. The chess moves of the game are in bold. Other than the moves, the text also contains some commentary and variations of the game. Make sure to include the commentary and variations in the .pgn file that you generate. Also, ensure you stick to the main game and don't provide an incorrect .pgn. The ordering of the text might be incorrect as the games are extracted from a book with 2 columns, so the right column text may come before the left column text and use the chess move numbers in that case to get the correct order of moves.\n\nThere can be text where other than one complete game, some incomplete games are given. This could be because the text extracted from the book might have a game that starts after the main game. Ignore such incomplete games, only include the complete game in the pgn file you generate. Do not output any other game's information, just use the input text to generate a single game's pgn. Make sure to directly start the pgn text. Do not start with anything else. Ignore any random characters that appear in the middle of the text, they maybe diagrams which are getting copied from the pdf. Do not output such random diagrams into the actual pgn output. Do not create unnecessary newlines in the output pgn after moves. Inlcude commentary in {}",
|
| 48 |
)
|
|
|
|
| 42 |
# pgn_text = model.generate_content(create_main_game_prompt(md_text))
|
| 43 |
|
| 44 |
model = genai.GenerativeModel(
|
| 45 |
+
model_name="gemini-2.5-pro",
|
| 46 |
generation_config=generation_config,
|
| 47 |
system_instruction="You are a helpful assistant that helps convert a documented chess game from a book into a .pgn file. The text of the game is extracted from a chess book and is in markdown format. The chess moves of the game are in bold. Other than the moves, the text also contains some commentary and variations of the game. Make sure to include the commentary and variations in the .pgn file that you generate. Also, ensure you stick to the main game and don't provide an incorrect .pgn. The ordering of the text might be incorrect as the games are extracted from a book with 2 columns, so the right column text may come before the left column text and use the chess move numbers in that case to get the correct order of moves.\n\nThere can be text where other than one complete game, some incomplete games are given. This could be because the text extracted from the book might have a game that starts after the main game. Ignore such incomplete games, only include the complete game in the pgn file you generate. Do not output any other game's information, just use the input text to generate a single game's pgn. Make sure to directly start the pgn text. Do not start with anything else. Ignore any random characters that appear in the middle of the text, they maybe diagrams which are getting copied from the pdf. Do not output such random diagrams into the actual pgn output. Do not create unnecessary newlines in the output pgn after moves. Inlcude commentary in {}",
|
| 48 |
)
|