Spaces:
Runtime error
Runtime error
granite model
Browse files
app.py
CHANGED
|
@@ -12,7 +12,12 @@ token = os.getenv("HUGGINGFACE_API_TOKEN")
|
|
| 12 |
|
| 13 |
print(f'HUGGINGFACE_API_TOKEN: {token}')
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# pipe.to('cuda')
|
| 18 |
|
|
@@ -26,6 +31,6 @@ def generate(prompt):
|
|
| 26 |
|
| 27 |
gr.Interface(
|
| 28 |
fn=generate,
|
| 29 |
-
inputs=gr.Text(),
|
| 30 |
outputs=gr.Text(),
|
| 31 |
).launch()
|
|
|
|
| 12 |
|
| 13 |
print(f'HUGGINGFACE_API_TOKEN: {token}')
|
| 14 |
|
| 15 |
+
model = "meta-llama/Meta-Llama-3-8B-Instruct"
|
| 16 |
+
model = "ibm-granite/granite-3b-code-instruct"
|
| 17 |
+
|
| 18 |
+
print(f'Loading model {model}')
|
| 19 |
+
|
| 20 |
+
pipe = pipeline("text-generation", model, torch_dtype=torch.bfloat16, device_map="auto", token=token)
|
| 21 |
|
| 22 |
# pipe.to('cuda')
|
| 23 |
|
|
|
|
| 31 |
|
| 32 |
gr.Interface(
|
| 33 |
fn=generate,
|
| 34 |
+
inputs=gr.Text("When is the next solar eclipse?"),
|
| 35 |
outputs=gr.Text(),
|
| 36 |
).launch()
|