You are not logged in.

#1 2022-12-06 09:03:38

martinligabue
Member
Registered: 2022-12-06
Posts: 4

gpt2tc

I found this package not on AUR, in the website there is the tar gz file, may this be added? I have no experience at all with anything code related, I don't know how to make the package build file. The website says it doesn't need any external dependency, I hope it's easy to make. Also it's an year it's not updated, so it shouldn't need maintenance(?)

https://bellard.org/libnc/gpt2tc.html

Offline

#2 2022-12-06 20:25:04

loqs
Member
Registered: 2014-03-06
Posts: 17,193

Re: gpt2tc

This builds gpt2tc and packages the bundles libnc.so.  gpt2_117M.bin extracted from gpt2tc-117M.tar.gz is not packaged as I do not know where to put it.

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name <youremail@domain.com>
pkgname=gpt2tc
pkgver=2021_04_24
pkgrel=1
pkgdesc="A small program using the GPT-2 language model to complete and compress (English) texts."
arch=('x86_64')
url="https://bellard.org/libnc/gpt2tc.html"
license=('Custom' 'MIT')
depends=('glibc')
source=("https://bellard.org/libnc/$pkgname-${pkgver//_/-}.tar.gz"
         https://bellard.org/libnc/$pkgname-117M.tar.gz)
sha256sums=('9079d1ce248d45ec227ccfe82834301b6eeb5d1be7b6e5145fc33e3d4347a40e'
            '5af66e4c605c717e0baae115b23ab4cc5f195bf586b8b9d5589888410c648a97')

build() {
	cd $pkgname-${pkgver//_/-}
	make LDFLAGS="$LDFLAGS"
}

package() {
	cd $pkgname-${pkgver//_/-}
	echo "The LibNC library is free to use as a binary shared library. Contact the author if access to its source code is required." > libNC.license
	sed -n '/Text Completion with GPT-2 Transformer/,/THE SOFTWARE\./p' gpt2tc.c > gpt2tc.license
	install -Dt "$pkgdir/usr/share/licenses/$pkgname/" -m644 libNC.license
	install -Dt "$pkgdir/usr/share/licenses/$pkgname/" -m644 gpt2tc.license
	install -Dt "$pkgdir"/usr/lib/ libnc.so
	install -Dt "$pkgdir"/usr/bin/ gpt2tc
}

Online

#3 2022-12-06 21:08:39

martinligabue
Member
Registered: 2022-12-06
Posts: 4

Re: gpt2tc

in the docs here https://bellard.org/libnc/readme-gpt2tc.txt it says to just extract the model in the directory(?)

Offline

#4 2022-12-06 21:30:37

loqs
Member
Registered: 2014-03-06
Posts: 17,193

Re: gpt2tc

martinligabue wrote:

in the docs here https://bellard.org/libnc/readme-gpt2tc.txt it says to just extract the model in the directory(?)

That could be interpreted as the current working directory or the directory where the executable was installed.  The Makefile does not support an install target.  Perhaps it is not intended to be installed system wide but extracted,  built and used all in the same directory.

Last edited by loqs (2022-12-06 21:30:51)

Online

#5 2022-12-06 21:32:06

martinligabue
Member
Registered: 2022-12-06
Posts: 4

Re: gpt2tc

yeah, it might be, so does it mean it's not for aur or it can be, but with a warning that the user should download the model?

Offline

#6 2022-12-06 21:51:46

loqs
Member
Registered: 2014-03-06
Posts: 17,193

Re: gpt2tc

From the readme.txt:  "This demo has no external dependency. It is written in C and uses the LibNC library for tensor manipulation. The CPU must support AVX2."
I would lean more towards it not being very suitable for AUR as it seems to be a demo for libNC.

Online

#7 2022-12-06 21:57:25

martinligabue
Member
Registered: 2022-12-06
Posts: 4

Re: gpt2tc

thanks for the clarification!

Offline

Board footer

Powered by FluxBB