kiranb99 commited on
Commit
6712c6e
1 Parent(s): c175c45

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -16
main.py CHANGED
@@ -1,16 +1,6 @@
1
- from fastapi import FastAPI
2
-
3
- app = FastAPI()
4
-
5
- @app.get("/")
6
- def read_root():
7
- import torch
8
- from transformers import pipeline
9
-
10
- # use dolly-v2-12b if you're using Colab Pro+, using pythia-2.8b for Free Colab
11
- generate_text = pipeline(model="databricks/dolly-v2-2-8b",
12
- torch_dtype=torch.bfloat16,
13
- trust_remote_code=True,
14
- device_map="auto")
15
- txt = generate_text("Whats the difference between an apple and broccoli?")
16
- return txt
 
1
+ from transformers import pipeline
2
+ generate_text = pipeline(model="databricks/dolly-v2-2-8b",
3
+ torch_dtype=torch.bfloat16,
4
+ trust_remote_code=True,
5
+ device_map="auto")
6
+ generate_text("Whats the difference between an apple and broccoli?")