Spaces:
Runtime error
Runtime error
Download utils/cot.py from ankush-003/MahaNeta: direct link, hf CLI and curl.
- Browser
- Download file 829 Bytes
-
https://huggingface.co/spaces/ankush-003/MahaNeta/resolve/main/utils/cot.py
- Command line
-
hf download hf://spaces/ankush-003/MahaNeta/utils/cot.py
-
curl -L -o cot.py https://huggingface.co/spaces/ankush-003/MahaNeta/resolve/main/utils/cot.py
829 Bytes
| """ | |
| This example is to show Chain Of Thought | |
| """ | |
| from langchain import PromptTemplate | |
| from load_llm import load_llm | |
| template = """Answer the question based on the context below. If the | |
| question cannot be answered using the information provided answer | |
| with "I don't know". | |
| Q: Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can contains 3 tennis balls. How many | |
| tennis balls does he have now? | |
| A: Roger started with 5 balls. 2 cans of 3 tennis balls is 6 tennis balls. 5+6 = 11.The answer is 11. | |
| Q: The cafetaria has 23 apples. If they used 20 apples for lunch and bought 6 more, how many apples do they have? | |
| """ | |
| prompt_template = PromptTemplate( | |
| input_variables=[], | |
| template=template | |
| ) | |
| prompt = prompt_template.format( | |
| ) | |
| llm = load_llm() | |
| print(llm(prompt)) | |